src/Entity/Equipe.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EquipeRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. #[ORM\Entity(repositoryClassEquipeRepository::class)]
  11. #[Vich\Uploadable]
  12. class Equipe
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $nom null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $diplome null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $poste null;
  24.     #[ORM\Column(type:'integer'length:11)]
  25.     private ?int $experience null;
  26.     #[ORM\Column(length255)]
  27.     private ?string $regional null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $unite null;
  30.     #[ORM\OneToMany(mappedBy'equipe'targetEntityDomainEquipe::class, cascade: ['persist''remove'])]
  31.     private $domains;
  32.     #[ORM\Column(type:'string'length:255)]
  33.     private $image;
  34.     #[Vich\UploadableField(mapping:'post_thumbnails'fileNameProperty:'image')]
  35.     private $imageFile;
  36.     public function __construct()
  37.     {
  38.         $this->domains = new ArrayCollection();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getNom(): ?string
  45.     {
  46.         return $this->nom;
  47.     }
  48.     public function setNom(string $nom): self
  49.     {
  50.         $this->nom $nom;
  51.         return $this;
  52.     }
  53.     public function getDiplome(): ?string
  54.     {
  55.         return $this->diplome;
  56.     }
  57.     public function setDiplome(string $diplome): self
  58.     {
  59.         $this->diplome $diplome;
  60.         return $this;
  61.     }
  62.     public function getPoste(): ?string
  63.     {
  64.         return $this->poste;
  65.     }
  66.     public function setPoste(string $poste): self
  67.     {
  68.         $this->poste $poste;
  69.         return $this;
  70.     }
  71.     public function getExperience(): ?int
  72.     {
  73.         return $this->experience;
  74.     }
  75.     public function setExperience(int $experience): self
  76.     {
  77.         $this->experience $experience;
  78.         return $this;
  79.     }
  80.     public function getRegional(): ?string
  81.     {
  82.         return $this->regional;
  83.     }
  84.     public function setRegional(string $regional): self
  85.     {
  86.         $this->regional $regional;
  87.         return $this;
  88.     }
  89.     public function getUnite(): ?string
  90.     {
  91.         return $this->unite;
  92.     }
  93.     public function setUnite(string $unite): self
  94.     {
  95.         $this->unite $unite;
  96.         return $this;
  97.     }
  98.     public function setImageFile(File $image null)
  99.     {
  100.         $this->imageFile $image;
  101.         // VERY IMPORTANT:
  102.         // It is required that at least one field changes if you are using Doctrine,
  103.         // otherwise the event listeners won't be called and the file is lost
  104.         //  if ($image) {
  105.         // if 'updatedAt' is not defined in your entity, use another property
  106.         // $this->updatedAt = new \DateTime('now');
  107.         // }
  108.     }
  109.     public function getImageFile()
  110.     {
  111.         return $this->imageFile;
  112.     }
  113.     public function setImage($image)
  114.     {
  115.         $this->image $image;
  116.     }
  117.     public function getImage()
  118.     {
  119.         return $this->image;
  120.     }
  121.      /**
  122.      * @return Collection<int, DomainEquipe>
  123.      */
  124.     public function getDomains(): Collection
  125.     {
  126.         return $this->domains;
  127.     }
  128.     public function addDomain(DomainEquipe $domain): self
  129.     {
  130.         if (!$this->taches->contains($domain)) {
  131.             $this->taches->add($domain);
  132.             $domain->setEquipe($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeDomain(DomainEquipe $domain): self
  137.     {
  138.         if ($this->domains->removeElement($domain)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($domain->getEquipe() === $this) {
  141.                 $domain->setEquipe(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     public function __toString()
  147.     {
  148.         return (string) $this->id;
  149.     }
  150. }