src/Entity/Gos/MultipleFreeAccess.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Repository\Gos\MultipleFreeAccessRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=MultipleFreeAccessRepository::class)
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class MultipleFreeAccess
  10. {
  11.     public const TypesOfGrantingAccess =
  12.         [
  13.             'Based on regule',
  14.             'Based on email list',
  15.         ];
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $name;
  26.     /**
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private $rule;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     private $log;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      */
  37.     private $createdAt;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=true)
  40.      */
  41.     private $updatedAt;
  42.     /**
  43.      * @ORM\Column(type="datetime", nullable=true)
  44.      */
  45.     private $executedAt;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=ProductVariant::class)
  48.      * @ORM\JoinColumn(nullable=false)
  49.      */
  50.     private $productVariantToGiveAccess;
  51.     /**
  52.      * @ORM\Column(type="datetime")
  53.      */
  54.     private $giveAccessTo;
  55.     /**
  56.      * @ORM\Column(type="datetime", nullable=true)
  57.      */
  58.     private $ordersFromDate;
  59.     /**
  60.      * @ORM\Column(type="integer")
  61.      */
  62.     private $type;
  63.     /**
  64.      * @ORM\Column(type="text", nullable=true)
  65.      */
  66.     private $emailList;
  67.     /**
  68.      * @ORM\PrePersist()
  69.      */
  70.     public function prePersist()
  71.     {
  72.         $this->createdAt = new \DateTime();
  73.     }
  74.     /**
  75.      * @ORM\PreUpdate()
  76.      */
  77.     public function preUpdate()
  78.     {
  79.         $this->updatedAt = new \DateTime();
  80.     }
  81.     public function getId(): ?int
  82.     {
  83.         return $this->id;
  84.     }
  85.     public function getTypeName(): ?string
  86.     {
  87.         if (is_null($this->getType()))
  88.         {
  89.             return null;
  90.         }
  91.         return self::TypesOfGrantingAccess[$this->getType()];
  92.     }
  93.     public function getName(): ?string
  94.     {
  95.         return $this->name;
  96.     }
  97.     public function setName(string $name): self
  98.     {
  99.         $this->name $name;
  100.         return $this;
  101.     }
  102.     public function getRule(): ?string
  103.     {
  104.         return $this->rule;
  105.     }
  106.     public function setRule(string $rule): self
  107.     {
  108.         $this->rule $rule;
  109.         return $this;
  110.     }
  111.     public function getLog(): ?string
  112.     {
  113.         return $this->log;
  114.     }
  115.     public function setLog(?string $log): self
  116.     {
  117.         $this->log $log;
  118.         return $this;
  119.     }
  120.     public function getCreatedAt(): ?\DateTimeInterface
  121.     {
  122.         return $this->createdAt;
  123.     }
  124.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  125.     {
  126.         $this->createdAt $createdAt;
  127.         return $this;
  128.     }
  129.     public function getUpdatedAt(): ?\DateTimeInterface
  130.     {
  131.         return $this->updatedAt;
  132.     }
  133.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  134.     {
  135.         $this->updatedAt $updatedAt;
  136.         return $this;
  137.     }
  138.     public function getExecutedAt(): ?\DateTimeInterface
  139.     {
  140.         return $this->executedAt;
  141.     }
  142.     public function setExecutedAt(?\DateTimeInterface $executedAt): self
  143.     {
  144.         $this->executedAt $executedAt;
  145.         return $this;
  146.     }
  147.     public function getProductVariantToGiveAccess(): ?ProductVariant
  148.     {
  149.         return $this->productVariantToGiveAccess;
  150.     }
  151.     public function setProductVariantToGiveAccess(?ProductVariant $productVariantToGiveAccess): self
  152.     {
  153.         $this->productVariantToGiveAccess $productVariantToGiveAccess;
  154.         return $this;
  155.     }
  156.     public function getGiveAccessTo(): ?\DateTimeInterface
  157.     {
  158.         return $this->giveAccessTo;
  159.     }
  160.     public function setGiveAccessTo(\DateTimeInterface $giveAccessTo): self
  161.     {
  162.         $this->giveAccessTo $giveAccessTo;
  163.         return $this;
  164.     }
  165.     public function getOrdersFromDate(): ?\DateTimeInterface
  166.     {
  167.         return $this->ordersFromDate;
  168.     }
  169.     public function setOrdersFromDate(?\DateTimeInterface $ordersFromDate): self
  170.     {
  171.         $this->ordersFromDate $ordersFromDate;
  172.         return $this;
  173.     }
  174.     public function getType(): ?int
  175.     {
  176.         return $this->type;
  177.     }
  178.     public function setType(int $type): self
  179.     {
  180.         $this->type $type;
  181.         return $this;
  182.     }
  183.     public function getEmailList(): ?string
  184.     {
  185.         return $this->emailList;
  186.     }
  187.     public function setEmailList(?string $emailList): self
  188.     {
  189.         $this->emailList $emailList;
  190.         return $this;
  191.     }
  192. }