<?phpnamespace App\Entity\Gos;use App\Repository\Gos\MultipleFreeAccessRepository;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=MultipleFreeAccessRepository::class) * @ORM\HasLifecycleCallbacks() */class MultipleFreeAccess{ public const TypesOfGrantingAccess = [ 'Based on regule', 'Based on email list', ]; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="text", nullable=true) */ private $rule; /** * @ORM\Column(type="text", nullable=true) */ private $log; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $executedAt; /** * @ORM\ManyToOne(targetEntity=ProductVariant::class) * @ORM\JoinColumn(nullable=false) */ private $productVariantToGiveAccess; /** * @ORM\Column(type="datetime") */ private $giveAccessTo; /** * @ORM\Column(type="datetime", nullable=true) */ private $ordersFromDate; /** * @ORM\Column(type="integer") */ private $type; /** * @ORM\Column(type="text", nullable=true) */ private $emailList; /** * @ORM\PrePersist() */ public function prePersist() { $this->createdAt = new \DateTime(); } /** * @ORM\PreUpdate() */ public function preUpdate() { $this->updatedAt = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getTypeName(): ?string { if (is_null($this->getType())) { return null; } return self::TypesOfGrantingAccess[$this->getType()]; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getRule(): ?string { return $this->rule; } public function setRule(string $rule): self { $this->rule = $rule; return $this; } public function getLog(): ?string { return $this->log; } public function setLog(?string $log): self { $this->log = $log; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getExecutedAt(): ?\DateTimeInterface { return $this->executedAt; } public function setExecutedAt(?\DateTimeInterface $executedAt): self { $this->executedAt = $executedAt; return $this; } public function getProductVariantToGiveAccess(): ?ProductVariant { return $this->productVariantToGiveAccess; } public function setProductVariantToGiveAccess(?ProductVariant $productVariantToGiveAccess): self { $this->productVariantToGiveAccess = $productVariantToGiveAccess; return $this; } public function getGiveAccessTo(): ?\DateTimeInterface { return $this->giveAccessTo; } public function setGiveAccessTo(\DateTimeInterface $giveAccessTo): self { $this->giveAccessTo = $giveAccessTo; return $this; } public function getOrdersFromDate(): ?\DateTimeInterface { return $this->ordersFromDate; } public function setOrdersFromDate(?\DateTimeInterface $ordersFromDate): self { $this->ordersFromDate = $ordersFromDate; return $this; } public function getType(): ?int { return $this->type; } public function setType(int $type): self { $this->type = $type; return $this; } public function getEmailList(): ?string { return $this->emailList; } public function setEmailList(?string $emailList): self { $this->emailList = $emailList; return $this; }}