src/Entity/CategoriesAnnonces.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CategoriesAnnoncesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassCategoriesAnnoncesRepository::class)]
  9. class CategoriesAnnonces
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $name null;
  17.     #[ORM\Column(typeTypes::TEXT)]
  18.     private ?string $description null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $slug null;
  21.     #[ORM\OneToMany(mappedBy'categoriesannonces'targetEntityAnnonces::class)]
  22.     private Collection $annonces;
  23.     public function __construct()
  24.     {
  25.         $this->annonces = new ArrayCollection();
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getName(): ?string
  32.     {
  33.         return $this->name;
  34.     }
  35.     public function setName(string $name): static
  36.     {
  37.         $this->name $name;
  38.         return $this;
  39.     }
  40.     public function getDescription(): ?string
  41.     {
  42.         return $this->description;
  43.     }
  44.     public function setDescription(string $description): static
  45.     {
  46.         $this->description $description;
  47.         return $this;
  48.     }
  49.     public function getSlug(): ?string
  50.     {
  51.         return $this->slug;
  52.     }
  53.     public function setSlug(string $slug): static
  54.     {
  55.         $this->slug $slug;
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection<int, Annonces>
  60.      */
  61.     public function getAnnonces(): Collection
  62.     {
  63.         return $this->annonces;
  64.     }
  65.     public function addAnnonce(Annonces $annonce): static
  66.     {
  67.         if (!$this->annonces->contains($annonce)) {
  68.             $this->annonces->add($annonce);
  69.             $annonce->setCategoriesannonces($this);
  70.         }
  71.         return $this;
  72.     }
  73.     public function removeAnnonce(Annonces $annonce): static
  74.     {
  75.         if ($this->annonces->removeElement($annonce)) {
  76.             // set the owning side to null (unless already changed)
  77.             if ($annonce->getCategoriesannonces() === $this) {
  78.                 $annonce->setCategoriesannonces(null);
  79.             }
  80.         }
  81.         return $this;
  82.     }
  83. }