src/Entity/ContactSheet/PriorityContact.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\ContactSheet;
  3. use App\Entity\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\App\ContactSheet\PriorityContactRepository")
  8.  * @ORM\Table(name="ContactSheetPriorityContact")
  9.  */
  10. class PriorityContact
  11. {
  12.     public const FIRST_CONTACT 'FIRST_CONTACT';
  13.     public const SECOND_CONTACT 'SECOND_CONTACT';
  14.     public const THIRD_CONTACT 'THIRD_CONTACT';
  15.     public const FOURTH_CONTACT 'FOURTH_CONTACT';
  16.     public const CRISIS_CONTACT 'CRISIS_CONTACT';
  17.     /**
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      * @Assert\NotBlank
  27.      */
  28.     private $user;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\ContactSheet\ContactSheet", inversedBy="priorityContacts")
  31.      * @ORM\JoinColumn(nullable=false)
  32.      * @Assert\NotBlank
  33.      */
  34.     private $contactSheet;
  35.     /**
  36.      * @ORM\Column(type="string", length=255)
  37.      * @Assert\Choice({
  38.      *     PriorityContact::FIRST_CONTACT,
  39.      *     PriorityContact::SECOND_CONTACT,
  40.      *     PriorityContact::THIRD_CONTACT,
  41.      *     PriorityContact::FOURTH_CONTACT,
  42.      *     PriorityContact::CRISIS_CONTACT
  43.      * })
  44.      */
  45.     private $priority;
  46.     public function __construct(string $priorityUser $user)
  47.     {
  48.         $this->setPriority($priority);
  49.         $this->setUser($user);
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getUser(): ?User
  56.     {
  57.         return $this->user;
  58.     }
  59.     public function setUser(?User $user): self
  60.     {
  61.         $this->user $user;
  62.         return $this;
  63.     }
  64.     public function getContactSheet(): ?ContactSheet
  65.     {
  66.         return $this->contactSheet;
  67.     }
  68.     public function setContactSheet(?ContactSheet $contactSheet): self
  69.     {
  70.         $this->contactSheet $contactSheet;
  71.         return $this;
  72.     }
  73.     public function getPriority(): ?string
  74.     {
  75.         return $this->priority;
  76.     }
  77.     public function setPriority(string $priority): self
  78.     {
  79.         $this->priority $priority;
  80.         return $this;
  81.     }
  82. }