<?php
namespace App\Domain\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use App\Domain\Entity\Behavior\Identifiable;
use Gedmo\SoftDeleteable\Traits\SoftDeleteable;
use Gedmo\Timestampable\Traits\Timestampable;
/**
* Class Language
* @package App\Domain\Entity
*/
#[ApiResource(
operations : [
new Get(),
new GetCollection(filters: ['locale.search_filter']),
new Post()
],
normalizationContext : ['groups' => ['locale_read']],
denormalizationContext: ['groups' => ['locale_write']]
)]
class Locale
{
use Identifiable;
use SoftDeleteable;
use Timestampable;
public function __construct(
public string $alpha2,
public string $alpha3,
public string $code,
public string $iso,
public bool $isDefault = false
) {
}
}