<?phpnamespace App\Entity\ContactSheet;use App\Entity\User;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity(repositoryClass="App\Repository\App\ContactSheet\PriorityContactRepository") * @ORM\Table(name="ContactSheetPriorityContact") */class PriorityContact{ public const FIRST_CONTACT = 'FIRST_CONTACT'; public const SECOND_CONTACT = 'SECOND_CONTACT'; public const THIRD_CONTACT = 'THIRD_CONTACT'; public const FOURTH_CONTACT = 'FOURTH_CONTACT'; public const CRISIS_CONTACT = 'CRISIS_CONTACT'; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity="App\Entity\User") * @ORM\JoinColumn(nullable=false) * @Assert\NotBlank */ private $user; /** * @ORM\ManyToOne(targetEntity="App\Entity\ContactSheet\ContactSheet", inversedBy="priorityContacts") * @ORM\JoinColumn(nullable=false) * @Assert\NotBlank */ private $contactSheet; /** * @ORM\Column(type="string", length=255) * @Assert\Choice({ * PriorityContact::FIRST_CONTACT, * PriorityContact::SECOND_CONTACT, * PriorityContact::THIRD_CONTACT, * PriorityContact::FOURTH_CONTACT, * PriorityContact::CRISIS_CONTACT * }) */ private $priority; public function __construct(string $priority, User $user) { $this->setPriority($priority); $this->setUser($user); } public function getId(): ?int { return $this->id; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getContactSheet(): ?ContactSheet { return $this->contactSheet; } public function setContactSheet(?ContactSheet $contactSheet): self { $this->contactSheet = $contactSheet; return $this; } public function getPriority(): ?string { return $this->priority; } public function setPriority(string $priority): self { $this->priority = $priority; return $this; }}