src/Entity/Image.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ImageRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassImageRepository::class)]
  8. class Image
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $nom null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $path null;
  18.     #[ORM\Column]
  19.     private ?int $type null;
  20.     #[ORM\OneToMany(mappedBy'image'targetEntityClient::class)]
  21.     private Collection $clients;
  22.     #[ORM\OneToMany(mappedBy'image'targetEntityHistorique::class)]
  23.     private Collection $historiques;
  24.     #[ORM\OneToMany(mappedBy'image'targetEntityMetierFormation::class)]
  25.     private Collection $metierFormations;
  26.     #[ORM\OneToMany(mappedBy'image'targetEntityMetierRh::class)]
  27.     private Collection $metierRhs;
  28.     public function __construct()
  29.     {
  30.         $this->clients = new ArrayCollection();
  31.         $this->historiques = new ArrayCollection();
  32.         $this->metierFormations = new ArrayCollection();
  33.         $this->metierRhs = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getNom(): ?string
  40.     {
  41.         return $this->nom;
  42.     }
  43.     public function setNom(string $nom): self
  44.     {
  45.         $this->nom $nom;
  46.         return $this;
  47.     }
  48.     public function getPath(): ?string
  49.     {
  50.         return $this->path;
  51.     }
  52.     public function setPath(string $path): self
  53.     {
  54.         $this->path $path;
  55.         return $this;
  56.     }
  57.     public function getType(): ?int
  58.     {
  59.         return $this->type;
  60.     }
  61.     public function setType(int $type): self
  62.     {
  63.         $this->type $type;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, Client>
  68.      */
  69.     public function getClients(): Collection
  70.     {
  71.         return $this->clients;
  72.     }
  73.     public function addClient(Client $client): self
  74.     {
  75.         if (!$this->clients->contains($client)) {
  76.             $this->clients->add($client);
  77.             $client->setImage($this);
  78.         }
  79.         return $this;
  80.     }
  81.     public function removeClient(Client $client): self
  82.     {
  83.         if ($this->clients->removeElement($client)) {
  84.             // set the owning side to null (unless already changed)
  85.             if ($client->getImage() === $this) {
  86.                 $client->setImage(null);
  87.             }
  88.         }
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, Historique>
  93.      */
  94.     public function getHistoriques(): Collection
  95.     {
  96.         return $this->historiques;
  97.     }
  98.     public function addHistorique(Historique $historique): self
  99.     {
  100.         if (!$this->historiques->contains($historique)) {
  101.             $this->historiques->add($historique);
  102.             $historique->setImage($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeHistorique(Historique $historique): self
  107.     {
  108.         if ($this->historiques->removeElement($historique)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($historique->getImage() === $this) {
  111.                 $historique->setImage(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116.     /**
  117.      * @return Collection<int, MetierFormation>
  118.      */
  119.     public function getMetierFormations(): Collection
  120.     {
  121.         return $this->metierFormations;
  122.     }
  123.     public function addMetierFormation(MetierFormation $metierFormation): self
  124.     {
  125.         if (!$this->metierFormations->contains($metierFormation)) {
  126.             $this->metierFormations->add($metierFormation);
  127.             $metierFormation->setImage($this);
  128.         }
  129.         return $this;
  130.     }
  131.     public function removeMetierFormation(MetierFormation $metierFormation): self
  132.     {
  133.         if ($this->metierFormations->removeElement($metierFormation)) {
  134.             // set the owning side to null (unless already changed)
  135.             if ($metierFormation->getImage() === $this) {
  136.                 $metierFormation->setImage(null);
  137.             }
  138.         }
  139.         return $this;
  140.     }
  141.     /**
  142.      * @return Collection<int, MetierRh>
  143.      */
  144.     public function getMetierRhs(): Collection
  145.     {
  146.         return $this->metierRhs;
  147.     }
  148.     public function addMetierRh(MetierRh $metierRh): self
  149.     {
  150.         if (!$this->metierRhs->contains($metierRh)) {
  151.             $this->metierRhs->add($metierRh);
  152.             $metierRh->setImage($this);
  153.         }
  154.         return $this;
  155.     }
  156.     public function removeMetierRh(MetierRh $metierRh): self
  157.     {
  158.         if ($this->metierRhs->removeElement($metierRh)) {
  159.             // set the owning side to null (unless already changed)
  160.             if ($metierRh->getImage() === $this) {
  161.                 $metierRh->setImage(null);
  162.             }
  163.         }
  164.         return $this;
  165.     }
  166. }