src/Entity/Webfactory/Actualites/WebfactoryActualiteBibliotheque.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Webfactory\Actualites;
  3. use App\Repository\Webfactory\Actualites\WebfactoryActualiteBibliothequeRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassWebfactoryActualiteBibliothequeRepository::class)]
  9. class WebfactoryActualiteBibliotheque
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $author null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $image null;
  19.     #[ORM\Column]
  20.     private ?DateTimeImmutable $created_at null;
  21.     #[ORM\Column]
  22.     private ?DateTimeImmutable $updated_at null;
  23.     #[ORM\Column]
  24.     private ?bool $active null;
  25.     #[ORM\OneToMany(mappedBy'actualiteBibliotheque'targetEntityWebfactoryActualiteBibliothequeContenu::class)]
  26.     private Collection $webfactoryActualiteBibliothequeContenus;
  27.     #[ORM\OneToMany(mappedBy'actualiteBibliotheque'targetEntityWebfactoryActualite::class)]
  28.     private Collection $webfactoryActualites;
  29.     #[ORM\ManyToOne(inversedBy'webfactoryActualiteBibliotheques')]
  30.     private ?WebfactoryActualiteCategory $webfactoryCategory null;
  31.     public function __construct()
  32.     {
  33.         $this->webfactoryActualiteBibliothequeContenus = new ArrayCollection();
  34.         $this->webfactoryActualites = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getAuthor(): ?string
  41.     {
  42.         return $this->author;
  43.     }
  44.     public function setAuthor(?string $author): static
  45.     {
  46.         $this->author $author;
  47.         return $this;
  48.     }
  49.     public function getImage(): ?string
  50.     {
  51.         return $this->image;
  52.     }
  53.     public function setImage(?string $image): static
  54.     {
  55.         $this->image $image;
  56.         return $this;
  57.     }
  58.     public function getCreatedAt(): ?DateTimeImmutable
  59.     {
  60.         return $this->created_at;
  61.     }
  62.     public function setCreatedAt(DateTimeImmutable $created_at): static
  63.     {
  64.         $this->created_at $created_at;
  65.         return $this;
  66.     }
  67.     public function getUpdatedAt(): ?DateTimeImmutable
  68.     {
  69.         return $this->updated_at;
  70.     }
  71.     public function setUpdatedAt(DateTimeImmutable $updated_at): static
  72.     {
  73.         $this->updated_at $updated_at;
  74.         return $this;
  75.     }
  76.     public function isActive(): ?bool
  77.     {
  78.         return $this->active;
  79.     }
  80.     public function setActive(bool $active): static
  81.     {
  82.         $this->active $active;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return Collection<int, WebfactoryActualiteBibliothequeContenu>
  87.      */
  88.     public function getWebfactoryActualiteBibliothequeContenus(): Collection
  89.     {
  90.         return $this->webfactoryActualiteBibliothequeContenus;
  91.     }
  92.     public function addWebfactoryActualiteBibliothequeContenu(WebfactoryActualiteBibliothequeContenu $webfactoryActualiteBibliothequeContenu): static
  93.     {
  94.         if (!$this->webfactoryActualiteBibliothequeContenus->contains($webfactoryActualiteBibliothequeContenu)) {
  95.             $this->webfactoryActualiteBibliothequeContenus->add($webfactoryActualiteBibliothequeContenu);
  96.             $webfactoryActualiteBibliothequeContenu->setActualiteBibliotheque($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeWebfactoryActualiteBibliothequeContenu(WebfactoryActualiteBibliothequeContenu $webfactoryActualiteBibliothequeContenu): static
  101.     {
  102.         if ($this->webfactoryActualiteBibliothequeContenus->removeElement($webfactoryActualiteBibliothequeContenu)) {
  103.             // set the owning side to null (unless already changed)
  104.             if ($webfactoryActualiteBibliothequeContenu->getActualiteBibliotheque() === $this) {
  105.                 $webfactoryActualiteBibliothequeContenu->setActualiteBibliotheque(null);
  106.             }
  107.         }
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, WebfactoryActualite>
  112.      */
  113.     public function getWebfactoryActualites(): Collection
  114.     {
  115.         return $this->webfactoryActualites;
  116.     }
  117.     public function addWebfactoryActualite(WebfactoryActualite $webfactoryActualite): static
  118.     {
  119.         if (!$this->webfactoryActualites->contains($webfactoryActualite)) {
  120.             $this->webfactoryActualites->add($webfactoryActualite);
  121.             $webfactoryActualite->setActualiteBibliotheque($this);
  122.         }
  123.         return $this;
  124.     }
  125.     public function removeWebfactoryActualite(WebfactoryActualite $webfactoryActualite): static
  126.     {
  127.         if ($this->webfactoryActualites->removeElement($webfactoryActualite)) {
  128.             // set the owning side to null (unless already changed)
  129.             if ($webfactoryActualite->getActualiteBibliotheque() === $this) {
  130.                 $webfactoryActualite->setActualiteBibliotheque(null);
  131.             }
  132.         }
  133.         return $this;
  134.     }
  135.     public function getWebfactoryCategory(): ?WebfactoryActualiteCategory
  136.     {
  137.         return $this->webfactoryCategory;
  138.     }
  139.     public function setWebfactoryCategory(?WebfactoryActualiteCategory $webfactoryCategory): static
  140.     {
  141.         $this->webfactoryCategory $webfactoryCategory;
  142.         return $this;
  143.     }
  144.     public function toArray(): array
  145.     {
  146.         return get_object_vars($this);
  147.     }
  148. }