<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\AdvertisingRepository") * * @ORM\HasLifecycleCallbacks() */class Advertising{ public function __construct() { $this->advertisingBanners = new ArrayCollection(); } /** * @ORM\Id() * * @ORM\GeneratedValue() * * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", nullable=false, length=180) */ private $name = null; /** * @ORM\Column(type="datetime", nullable=true) */ private $publication_start = null; /** * @ORM\Column(type="datetime", nullable=true) */ private $publication_end = null; /** * @ORM\Column(type="boolean", nullable=false) */ private $publication_status = false; /** * @ORM\Column(type="datetime", nullable=true) */ private $deleted_at; /** * @ORM\OneToMany(targetEntity="App\Entity\AdvertisingBanner", mappedBy="advertising") */ private $advertisingBanners; /** * @ORM\Column(type="datetime", nullable=false) */ private $created_at; /** * @ORM\Column(type="datetime", nullable=true) */ private $updated_at = null; public function getId(): ?int { return $this->id; } public function getName() { return $this->name; } public function setName($name) { $this->name = $name; return $this; } public function getPublicationStart() { return $this->publication_start; } public function setPublicationStart($publication_start) { $this->publication_start = $publication_start; return $this; } public function getPublicationEnd() { return $this->publication_end; } public function setPublicationEnd($publication_end) { $this->publication_end = $publication_end; return $this; } public function getPublicationStatus() { return $this->publication_status; } public function setPublicationStatus($publication_status) { $this->publication_status = $publication_status; return $this; } public function getCreatedAt(): \DateTimeInterface { return $this->created_at; } public function setCreatedAt(\DateTimeInterface $created_at): self { $this->created_at = $created_at; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updated_at; } public function setUpdatedAt(?\DateTimeInterface $updated_at): self { $this->updated_at = $updated_at; return $this; } /** * @ORM\PrePersist */ public function setCreatedAtValue() { $this->setCreatedAt(new \DateTime()); } /** * @ORM\PreUpdate */ public function setUpdatedAtValue() { $this->setUpdatedAt(new \DateTime()); } public function getDeletedAt(): ?\DateTimeInterface { return $this->deleted_at; } public function setDeletedAt(?\DateTimeInterface $deleted_at): self { $this->deleted_at = $deleted_at; return $this; } /** * @return Collection|AdvertisingBanner[] */ public function getAdvertisingBanners(): Collection { return $this->advertisingBanners; } public function addAdvertisingBanner(AdvertisingBanner $advertisingBanner): self { if (!$this->advertisingBanners->contains($advertisingBanner)) { $this->advertisingBanners[] = $advertisingBanner; $advertisingBanner->setAdvertising($this); } return $this; } public function removeAdvertisingBanner(AdvertisingBanner $advertisingBanner): self { if ($this->advertisingBanners->contains($advertisingBanner)) { $this->advertisingBanners->removeElement($advertisingBanner); // set the owning side to null (unless already changed) if ($advertisingBanner->getAdvertising() === $this) { $advertisingBanner->setAdvertising(null); } } return $this; } public function __toString(): string { return $this->name; }}