src/Entity/Reference/ReferencePersonMaritalStatus.php line 31

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Reference;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\Reference\ReferencePersonMaritalStatusRepository;
  5. use App\Traits\RankTrait;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * @ApiResource(
  10.  *     security= "is_granted('ROLE_AGENT') or is_granted('ROLE_MANAGER')",
  11.  *     normalizationContext={"groups"={"reference-marital-status:read"}, "swagger_definition_name"="Read"},
  12.  *     denormalizationContext={"groups"={"reference-marital-status:write"}, "swagger_definition_name"="Write"},
  13.  *     itemOperations={
  14.  *          "get"
  15.  *     },
  16.  *     collectionOperations={
  17.  *           "get",
  18.  *
  19.  *     },
  20.  *     attributes={
  21.  *          "pagination_items_per_page"=10,
  22.  *          "formats"={"jsonld", "json", "html", "jsonhal", "csv"={"text/csv"} }
  23.  *     },
  24.  *     order={"rank"}
  25.  * )
  26.  * @ORM\Entity(repositoryClass=ReferencePersonMaritalStatusRepository::class)
  27.  */
  28. class ReferencePersonMaritalStatus
  29. {
  30.     use RankTrait;
  31.     public const TRANSLATION_DOMAIN 'reference_collaborator';
  32.     public const REFERENCE_MARITAL_STATUS_MARRIED 'reference.collaborator.marital.MARRIED';
  33.     public const REFERENCE_MARITAL_STATUS_WINDOWED 'reference.collaborator.marital.WINDOWED';
  34.     public const REFERENCE_MARITAL_STATUS_SEPARATED 'reference.collaborator.marital.SEPARATED';
  35.     public const REFERENCE_MARITAL_STATUS_DIVORCED 'reference.collaborator.marital.DIVORCED';
  36.     public const REFERENCE_MARITAL_STATUS_SINGLE 'reference.collaborator.marital.SINGLE';
  37.     public const REFERENCE_CODE_MARITAL_STATUS_MARRIED 'MARRIED';
  38.     public const REFERENCE_CODE_MARITAL_STATUS_WINDOWED 'WINDOWED ';
  39.     public const REFERENCE_CODE_MARITAL_STATUS_SEPARATED 'SEPARATED';
  40.     public const REFERENCE_CODE_MARITAL_STATUS_DIVORCED 'DIVORCED';
  41.     public const REFERENCE_CODE_MARITAL_STATUS_SINGLE 'SINGLE';
  42.     public const ALL_REFERENCE_MARITAL_STATUS = [
  43.         self::REFERENCE_MARITAL_STATUS_MARRIED,
  44.         self::REFERENCE_MARITAL_STATUS_WINDOWED,
  45.         self::REFERENCE_MARITAL_STATUS_SEPARATED,
  46.         self::REFERENCE_MARITAL_STATUS_DIVORCED,
  47.         self::REFERENCE_MARITAL_STATUS_SINGLE
  48.     ];
  49.     public const ALL_REFERENCE_CODE_MARITAL_STATUS = [
  50.         self::REFERENCE_CODE_MARITAL_STATUS_MARRIED,
  51.         self::REFERENCE_CODE_MARITAL_STATUS_WINDOWED,
  52.         self::REFERENCE_CODE_MARITAL_STATUS_SEPARATED,
  53.         self::REFERENCE_CODE_MARITAL_STATUS_DIVORCED,
  54.         self::REFERENCE_CODE_MARITAL_STATUS_SINGLE
  55.     ];
  56.     /**
  57.      * @ORM\Id
  58.      * @ORM\GeneratedValue
  59.      * @ORM\Column(type="integer")
  60.      *
  61.      * @Groups({
  62.      *    "reference-marital-status:read",
  63.      *    "directory:collaborator:search","abstract-colloborator:read",
  64.      *    "candidate:read",
  65.      * })
  66.      */
  67.     private $id;
  68.     /**
  69.      * @ORM\Column(type="string", length=255)
  70.      *
  71.      * @Groups({
  72.      *    "reference-marital-status:read",
  73.      *    "directory:collaborator:search","abstract-colloborator:read",
  74.      *    "candidate:read"
  75.      *
  76.      * })
  77.      */
  78.     private ?string $name;
  79.     /**
  80.      * @ORM\Column(type="string", length=255)
  81.      *
  82.      * @Groups({
  83.      *    "reference-marital-status:read",
  84.      *    "directory:collaborator:search","abstract-colloborator:read",
  85.      *    "candidate:read"
  86.      * })
  87.      */
  88.     private ?string $code;
  89.     public function getId(): ?int
  90.     {
  91.         return $this->id;
  92.     }
  93.     public function getName(): ?string
  94.     {
  95.         return $this->name;
  96.     }
  97.     public function setName(string $name): self
  98.     {
  99.         $this->name $name;
  100.         return $this;
  101.     }
  102.     public function getCode(): ?string
  103.     {
  104.         return $this->code;
  105.     }
  106.     public function setCode(string $code): self
  107.     {
  108.         $this->code $code;
  109.         return $this;
  110.     }
  111. }