src/Entity/Pages.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PagesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPagesRepository::class)]
  8. class Pages
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\Column(type'datetime')]
  17.     private $modified;
  18.     #[ORM\Column(type'datetime')]
  19.     private $created;
  20.     #[ORM\OneToMany(targetEntityBanners::class, mappedBy'page')]
  21.     private $banners;
  22.     #[ORM\OneToMany(targetEntityArticles::class, mappedBy'page')]
  23.     private $articles;
  24.     #[ORM\Column(type'text'nullabletrue)]
  25.     private $description;
  26.     public function __construct()
  27.     {
  28.         $this->banners = new ArrayCollection();
  29.         $this->articles = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getName(): ?string
  36.     {
  37.         return $this->name;
  38.     }
  39.     public function setName(string $name): self
  40.     {
  41.         $this->name $name;
  42.         return $this;
  43.     }
  44.     public function getModified(): ?\DateTimeInterface
  45.     {
  46.         return $this->modified;
  47.     }
  48.     public function setModified(\DateTimeInterface $modified): self
  49.     {
  50.         $this->modified $modified;
  51.         return $this;
  52.     }
  53.     public function getCreated(): ?\DateTimeInterface
  54.     {
  55.         return $this->created;
  56.     }
  57.     public function setCreated(\DateTimeInterface $created): self
  58.     {
  59.         $this->created $created;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return Collection<int, Banners>
  64.      */
  65.     public function getBanners(): Collection
  66.     {
  67.         return $this->banners;
  68.     }
  69.     public function addBanner(Banners $banner): self
  70.     {
  71.         if (!$this->banners->contains($banner)) {
  72.             $this->banners[] = $banner;
  73.             $banner->setPage($this);
  74.         }
  75.         return $this;
  76.     }
  77.     public function removeBanner(Banners $banner): self
  78.     {
  79.         if ($this->banners->removeElement($banner)) {
  80.             // set the owning side to null (unless already changed)
  81.             if ($banner->getPage() === $this) {
  82.                 $banner->setPage(null);
  83.             }
  84.         }
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection<int, Articles>
  89.      */
  90.     public function getArticles(): Collection
  91.     {
  92.         return $this->articles;
  93.     }
  94.     public function addArticle(Articles $article): self
  95.     {
  96.         if (!$this->articles->contains($article)) {
  97.             $this->articles[] = $article;
  98.             $article->setPage($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removeArticle(Articles $article): self
  103.     {
  104.         if ($this->articles->removeElement($article)) {
  105.             // set the owning side to null (unless already changed)
  106.             if ($article->getPage() === $this) {
  107.                 $article->setPage(null);
  108.             }
  109.         }
  110.         return $this;
  111.     }
  112.     public function getDescription(): ?string
  113.     {
  114.         return $this->description;
  115.     }
  116.     public function setDescription(?string $description): self
  117.     {
  118.         $this->description $description;
  119.         return $this;
  120.     }
  121. }