<?php
namespace App\Entity\Reference;
use App\Repository\Reference\ReferencePrescriberRelationRepository;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Prescriber;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource(
* security= "is_granted('ROLE_AGENT') or is_granted('ROLE_MANAGER')",
* normalizationContext={"groups"={"reference-prescriber-relation:read"}, "swagger_definition_name"="Read"},
* denormalizationContext={"groups"={"reference-prescriber-relation:write"}, "swagger_definition_name"="Write"},
* itemOperations={
* "get"
* },
* collectionOperations={
* "get"
*
* },
* attributes={
* "pagination_items_per_page"=10,
* "formats"={"jsonld", "json", "html", "jsonhal", "csv"={"text/csv"} }
* },
* )
* @ORM\Entity(repositoryClass=ReferencePrescriberRelationRepository::class)
*/
class ReferencePrescriberRelation
{
public const TRANSLATION_DOMAIN = 'reference_prescriber_relation';
public const REFERENCE_RELATION_PRESCRIBER_FRIEND = 'reference.relation.prescriber.FRIEND';
public const REFERENCE_RELATION_PRESCRIBER_FAMILY = 'reference.relation.prescriber.FAMILY';
public const REFERENCE_RELATION_PRESCRIBER_MERCHANT = 'reference.relation.prescriber.MERCHANT';
public const REFERENCE_RELATION_PRESCRIBER_AGENT = 'reference.relation.prescriber.AGENT';
public const REFERENCE_RELATION_PRESCRIBER_CONCIERGE = 'reference.relation.prescriber.CONCIERGE';
public const REFERENCE_RELATION_PRESCRIBER_GUARDIAN = 'reference.relation.prescriber.GUARDIAN';
public const REFERENCE_RELATION_PRESCRIBER_OTHER = 'reference.relation.prescriber.OTHER';
public const CODE_REFERENCE_RELATION_PRESCRIBER_FRIEND = 'FRIEND';
public const CODE_REFERENCE_RELATION_PRESCRIBER_FAMILY = 'FAMILY';
public const CODE_REFERENCE_RELATION_PRESCRIBER_MERCHANT = 'MERCHANT';
public const CODE_REFERENCE_RELATION_PRESCRIBER_AGENT = 'AGENT';
public const CODE_REFERENCE_RELATION_PRESCRIBER_CONCIERGE = 'CONCIERGE';
public const CODE_REFERENCE_RELATION_PRESCRIBER_GUARDIAN = 'GUARDIAN';
public const CODE_REFERENCE_RELATION_PRESCRIBER_OTHER = 'OTHER';
public const ALL_REFERENCE_RELATION_PRESCRIBER = [
self::REFERENCE_RELATION_PRESCRIBER_AGENT,
self::REFERENCE_RELATION_PRESCRIBER_FRIEND,
self::REFERENCE_RELATION_PRESCRIBER_CONCIERGE,
self::REFERENCE_RELATION_PRESCRIBER_FAMILY,
self::REFERENCE_RELATION_PRESCRIBER_GUARDIAN,
self::REFERENCE_RELATION_PRESCRIBER_MERCHANT,
self::REFERENCE_RELATION_PRESCRIBER_OTHER
];
public const ALL_CODE_REFERENCE_RELATION_PRESCRIBER = [
self::CODE_REFERENCE_RELATION_PRESCRIBER_AGENT,
self::CODE_REFERENCE_RELATION_PRESCRIBER_FRIEND,
self::CODE_REFERENCE_RELATION_PRESCRIBER_CONCIERGE,
self::CODE_REFERENCE_RELATION_PRESCRIBER_FAMILY,
self::CODE_REFERENCE_RELATION_PRESCRIBER_GUARDIAN,
self::CODE_REFERENCE_RELATION_PRESCRIBER_MERCHANT,
self::CODE_REFERENCE_RELATION_PRESCRIBER_OTHER
];
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*
* @Groups({
* "prescriber:read",
* "reference-prescriber-relation:read"
* })
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*
* @Groups({
* "prescriber:read",
* "reference-prescriber-relation:read"
* })
*/
private $code;
/**
* @ORM\Column(type="string", length=255)
*
* @Groups({
* "prescriber:read",
* "reference-prescriber-relation:read"
* })
*/
private $name;
public function getId(): ?int
{
return $this->id;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
}