<?php
namespace App\Entity\Reference;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\Reference\ReferencePersonMaritalStatusRepository;
use App\Traits\RankTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource(
* security= "is_granted('ROLE_AGENT') or is_granted('ROLE_MANAGER')",
* normalizationContext={"groups"={"reference-marital-status:read"}, "swagger_definition_name"="Read"},
* denormalizationContext={"groups"={"reference-marital-status:write"}, "swagger_definition_name"="Write"},
* itemOperations={
* "get"
* },
* collectionOperations={
* "get",
*
* },
* attributes={
* "pagination_items_per_page"=10,
* "formats"={"jsonld", "json", "html", "jsonhal", "csv"={"text/csv"} }
* },
* order={"rank"}
* )
* @ORM\Entity(repositoryClass=ReferencePersonMaritalStatusRepository::class)
*/
class ReferencePersonMaritalStatus
{
use RankTrait;
public const TRANSLATION_DOMAIN = 'reference_collaborator';
public const REFERENCE_MARITAL_STATUS_MARRIED = 'reference.collaborator.marital.MARRIED';
public const REFERENCE_MARITAL_STATUS_WINDOWED = 'reference.collaborator.marital.WINDOWED';
public const REFERENCE_MARITAL_STATUS_SEPARATED = 'reference.collaborator.marital.SEPARATED';
public const REFERENCE_MARITAL_STATUS_DIVORCED = 'reference.collaborator.marital.DIVORCED';
public const REFERENCE_MARITAL_STATUS_SINGLE = 'reference.collaborator.marital.SINGLE';
public const REFERENCE_CODE_MARITAL_STATUS_MARRIED = 'MARRIED';
public const REFERENCE_CODE_MARITAL_STATUS_WINDOWED = 'WINDOWED ';
public const REFERENCE_CODE_MARITAL_STATUS_SEPARATED = 'SEPARATED';
public const REFERENCE_CODE_MARITAL_STATUS_DIVORCED = 'DIVORCED';
public const REFERENCE_CODE_MARITAL_STATUS_SINGLE = 'SINGLE';
public const ALL_REFERENCE_MARITAL_STATUS = [
self::REFERENCE_MARITAL_STATUS_MARRIED,
self::REFERENCE_MARITAL_STATUS_WINDOWED,
self::REFERENCE_MARITAL_STATUS_SEPARATED,
self::REFERENCE_MARITAL_STATUS_DIVORCED,
self::REFERENCE_MARITAL_STATUS_SINGLE
];
public const ALL_REFERENCE_CODE_MARITAL_STATUS = [
self::REFERENCE_CODE_MARITAL_STATUS_MARRIED,
self::REFERENCE_CODE_MARITAL_STATUS_WINDOWED,
self::REFERENCE_CODE_MARITAL_STATUS_SEPARATED,
self::REFERENCE_CODE_MARITAL_STATUS_DIVORCED,
self::REFERENCE_CODE_MARITAL_STATUS_SINGLE
];
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*
* @Groups({
* "reference-marital-status:read",
* "directory:collaborator:search","abstract-colloborator:read",
* "candidate:read",
* })
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*
* @Groups({
* "reference-marital-status:read",
* "directory:collaborator:search","abstract-colloborator:read",
* "candidate:read"
*
* })
*/
private ?string $name;
/**
* @ORM\Column(type="string", length=255)
*
* @Groups({
* "reference-marital-status:read",
* "directory:collaborator:search","abstract-colloborator:read",
* "candidate:read"
* })
*/
private ?string $code;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
}