src/Entity/AccessCode.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use JMS\Serializer\Annotation\Expose;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use JMS\Serializer\Annotation\ExclusionPolicy;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * Page
  11.  *
  12.  * @ORM\Table(name="v_access_code")
  13.  * @ORM\Entity(repositoryClass="App\Repository\AccessCodeRepository")
  14.  * @ExclusionPolicy("all")
  15.  * @Gedmo\Loggable
  16.  */
  17. class AccessCode
  18. {
  19.     /**
  20.      * @var integer
  21.      *
  22.      * @ORM\Column(name="id", type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      * @Expose
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity="App\Entity\Clinic")
  30.      * @Assert\NotNull()
  31.      * @Gedmo\Versioned
  32.      */
  33.     private $clinic;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(name="code", type="string", length=255, unique=true)
  38.      * @Expose
  39.      * @Gedmo\Versioned
  40.      */
  41.     private $code;
  42.     /**
  43.      * @var boolean
  44.      *
  45.      * @ORM\Column(name="used", type="boolean")
  46.      * @Expose
  47.      * @Gedmo\Versioned
  48.      */
  49.     private $used true;
  50.     /**
  51.      * @var boolean
  52.      *
  53.      * @ORM\Column(name="enabled", type="boolean")
  54.      * @Expose
  55.      * @Gedmo\Versioned
  56.      */
  57.     private $enabled true;
  58.     /**
  59.      * @ORM\Column(type="text", name="note", nullable=true)
  60.      * @Gedmo\Versioned
  61.      */
  62.     private $note;
  63.     /**
  64.      * @var \DateTime
  65.      *
  66.      * @ORM\Column(type="datetime", name="expiry_date", nullable=true)
  67.      * @Gedmo\Versioned
  68.      * @Expose
  69.      */
  70.     private $expiryDate;
  71.     /**
  72.      * @var integer
  73.      *
  74.      * @ORM\Column(type="integer", name="active_duration", nullable=true)
  75.      * @Gedmo\Versioned
  76.      * @Expose
  77.      */
  78.     private $activeDuration;
  79.     /**
  80.      * @var \DateTime
  81.      *
  82.      * @ORM\Column(type="datetime", name="used_date", nullable=true)
  83.      * @Gedmo\Versioned
  84.      * @Expose
  85.      */
  86.     private $usedDate;
  87.     /**
  88.      * @var boolean
  89.      *
  90.      * @ORM\Column(name="assigned", type="boolean")
  91.      * @Expose
  92.      * @Gedmo\Versioned
  93.      */
  94.     private $assigned false;
  95.     use CreatedUpdatedTrait;
  96.     public function __toString()
  97.     {
  98.         return (string) $this->code;
  99.     }
  100.     /**
  101.      * Get id
  102.      *
  103.      * @return integer
  104.      */
  105.     public function getId()
  106.     {
  107.         return $this->id;
  108.     }
  109.     /**
  110.      * @return mixed
  111.      */
  112.     public function getClinic()
  113.     {
  114.         return $this->clinic;
  115.     }
  116.     /**
  117.      * @param mixed $clinic
  118.      */
  119.     public function setClinic($clinic): void
  120.     {
  121.         $this->clinic $clinic;
  122.     }
  123.     /**
  124.      * @return string
  125.      */
  126.     public function getCode(): ?string
  127.     {
  128.         return $this->code;
  129.     }
  130.     /**
  131.      * @param string $code
  132.      */
  133.     public function setCode(string $code): void
  134.     {
  135.         $this->code $code;
  136.     }
  137.     /**
  138.      * @return bool
  139.      */
  140.     public function isUsed(): bool
  141.     {
  142.         return $this->used;
  143.     }
  144.     /**
  145.      * @param bool $used
  146.      */
  147.     public function setUsed(bool $used): void
  148.     {
  149.         $this->used $used;
  150.     }
  151.     /**
  152.      * @return bool
  153.      */
  154.     public function isEnabled(): bool
  155.     {
  156.         return $this->enabled;
  157.     }
  158.     /**
  159.      * @param bool $enabled
  160.      */
  161.     public function setEnabled(bool $enabled): void
  162.     {
  163.         $this->enabled $enabled;
  164.     }
  165.     /**
  166.      * @return mixed
  167.      */
  168.     public function getNote()
  169.     {
  170.         return $this->note;
  171.     }
  172.     /**
  173.      * @param mixed $note
  174.      */
  175.     public function setNote($note): void
  176.     {
  177.         $this->note $note;
  178.     }
  179.     /**
  180.      * @return \DateTime
  181.      */
  182.     public function getExpiryDate(): ?\DateTime
  183.     {
  184.         return $this->expiryDate;
  185.     }
  186.     /**
  187.      * @param \DateTime $expiryDate
  188.      */
  189.     public function setExpiryDate(?\DateTime $expiryDate): void
  190.     {
  191.         $this->expiryDate $expiryDate;
  192.     }
  193.     /**
  194.      * @return int
  195.      */
  196.     public function getActiveDuration(): ?int
  197.     {
  198.         return $this->activeDuration;
  199.     }
  200.     /**
  201.      * @param int $activeDuration
  202.      */
  203.     public function setActiveDuration(?int $activeDuration): void
  204.     {
  205.         $this->activeDuration $activeDuration;
  206.     }
  207.     /**
  208.      * @return \DateTime
  209.      */
  210.     public function getUsedDate(): ?\DateTime
  211.     {
  212.         return $this->usedDate;
  213.     }
  214.     /**
  215.      * @param \DateTime $usedDate
  216.      */
  217.     public function setUsedDate(?\DateTime $usedDate): void
  218.     {
  219.         $this->usedDate $usedDate;
  220.     }
  221.     /**
  222.      * @return bool
  223.      */
  224.     public function isAssigned(): ?bool
  225.     {
  226.         return $this->assigned;
  227.     }
  228.     /**
  229.      * @param bool $assigned
  230.      */
  231.     public function setAssigned(?bool $assigned): void
  232.     {
  233.         $this->assigned $assigned;
  234.     }
  235. }