<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass="App\Repository\ChannelRepository") * * @ORM\HasLifecycleCallbacks() */class Channel{ public function __construct() { $this->menus = new ArrayCollection(); $this->categories = new ArrayCollection(); } /** * @ORM\Id() * * @ORM\GeneratedValue() * * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", nullable=false, length=180) */ private $name = null; public function getId(): ?int { return $this->id; } public function getName() { return $this->name; } public function setName($name) { $this->name = $name; return $this; } /** * @ORM\Column(type="datetime", nullable=false) */ private $created_at; /** * @ORM\Column(type="datetime", nullable=true) */ private $updated_at = null; 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()); } /** * @ORM\Column(type="datetime", nullable=true) */ private $deleted_at; /** * @ORM\OneToMany(targetEntity="App\Entity\ChannelMenu", mappedBy="channel") */ private $menus; public function getDeletedAt(): ?\DateTimeInterface { return $this->deleted_at; } public function setDeletedAt(?\DateTimeInterface $deleted_at): self { $this->deleted_at = $deleted_at; return $this; } /** * @return Collection|ChannelMenu[] */ public function getMenus(): Collection { return $this->menus; } public function addMenu(ChannelMenu $menu): self { if (!$this->menus->contains($menu)) { $this->menus[] = $menu; $menu->setChannel($this); } return $this; } public function removeMenu(ChannelMenu $menu): self { if ($this->menus->contains($menu)) { $this->menus->removeElement($menu); // set the owning side to null (unless already changed) if ($menu->getChannel() === $this) { $menu->setChannel(null); } } return $this; } /** * @ORM\OneToMany(targetEntity="App\Entity\ChannelCategory", mappedBy="channel") */ private $categories; /** * @return Collection|ChannelCategory[] */ public function getCategories(): Collection { return $this->categories; } public function addCategory(ChannelCategory $category): self { if (!$this->categories->contains($category)) { $this->categories[] = $category; $category->setChannel($this); } return $this; } public function removeCategory(ChannelCategory $category): self { if ($this->categories->contains($category)) { $this->categories->removeElement($category); // set the owning side to null (unless already changed) if ($category->getChannel() === $this) { $category->setChannel(null); } } return $this; } /** * @ORM\Column(type="boolean") */ private $active; public function getActive(): ?bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } /** * @ORM\ManyToOne(targetEntity="App\Entity\StaticPage", inversedBy="channels_homepages") * * @ORM\JoinColumn(nullable=true) */ private $homepage = null; /** * @return null */ public function getHomepage() { return $this->homepage; } /** * @param null $homepage * * @return Channel */ public function setHomepage($homepage) { $this->homepage = $homepage; return $this; }}