src/Entity/Apropos.php line 19

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestamp;
  4. use App\Repository\AproposRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use Symfony\Component\HttpFoundation\File\UploadedFile;
  11. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. #[ORM\Entity(repositoryClassAproposRepository::class)]
  14. #[ORM\HasLifecycleCallbacks]
  15. #[Vich\Uploadable]
  16. class Apropos
  17. {
  18.     use Timestamp;
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue]
  21.     #[ORM\Column]
  22.     private ?int $id null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $email null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $telephone null;
  27.     /**
  28.      * @var File|null
  29.      **/
  30.     #[Assert\Image(maxSize'50M'maxSizeMessage'Image trop volumineuse maximum 10Mb')]
  31.     #[Assert\Image(mimeTypes: ["image/jpeg""image/jpg""image/png""image/avif"], mimeTypesMessage"Mauvais format d'image (jpeg, jpg et png)")]
  32.     #[Vich\UploadableField(mapping'auteurs'fileNameProperty'photo')]
  33.     private $photoFile;
  34.     #[ORM\Column(length255nullabletrue)]
  35.     private ?string $photo null;
  36.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  37.     private ?string $presentation null;
  38.     #[ORM\ManyToOne(inversedBy'apropos')]
  39.     private ?User $user null;
  40.     #[ORM\Column]
  41.     private ?bool $online null;
  42.     #[ORM\Column(nullabletrue)]
  43.     private ?int $anneeExperience null;
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $fonction null;
  46.     #[ORM\Column(length255nullabletrue)]
  47.     private ?string $bureau null;
  48.     #[ORM\Column(length255nullabletrue)]
  49.     private ?string $whatsapp null;
  50.     #[ORM\OneToMany(mappedBy'apropos'targetEntityCommunaute::class, cascade: ['persist'])]
  51.     private Collection $communautes;
  52.     /**
  53.      * @var File|null
  54.      **/
  55.     #[Assert\Image(maxSize'50M'maxSizeMessage'Image trop volumineuse maximum 10Mb')]
  56.     #[Assert\Image(mimeTypes: ["image/jpeg""image/jpg""image/png""image/avif"], mimeTypesMessage"Mauvais format d'image (jpeg, jpg et png)")]
  57.     #[Vich\UploadableField(mapping'auteurs'fileNameProperty'image')]
  58.     private $imageFile;
  59.     #[ORM\Column(length255nullabletrue)]
  60.     private ?string $image null;
  61.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  62.     private ?string $historique null;
  63.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  64.     private ?string $mission null;
  65.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  66.     private ?string $approche null;
  67.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  68.     private ?string $vision null;
  69.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  70.     private ?string $valeurs null;
  71.     public function __construct()
  72.     {
  73.         $this->communautes = new ArrayCollection();
  74.     }
  75.     public function getId(): ?int
  76.     {
  77.         return $this->id;
  78.     }
  79.     public function getEmail(): ?string
  80.     {
  81.         return $this->email;
  82.     }
  83.     public function setEmail(string $email): self
  84.     {
  85.         $this->email $email;
  86.         return $this;
  87.     }
  88.     public function getTelephone(): ?string
  89.     {
  90.         return $this->telephone;
  91.     }
  92.     public function setTelephone(string $telephone): self
  93.     {
  94.         $this->telephone $telephone;
  95.         return $this;
  96.     }
  97.     public function getPhoto(): ?string
  98.     {
  99.         return $this->photo;
  100.     }
  101.     public function setPhoto(?string $photo): self
  102.     {
  103.         $this->photo $photo;
  104.         return $this;
  105.     }
  106.     public function getPresentation(): ?string
  107.     {
  108.         return $this->presentation;
  109.     }
  110.     public function setPresentation(?string $presentation): self
  111.     {
  112.         $this->presentation $presentation;
  113.         return $this;
  114.     }
  115.     /**
  116.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  117.      */
  118.     public function setImageFile(?File $imageFile null): void
  119.     {
  120.         $this->imageFile $imageFile;
  121.         if (null !== $imageFile) {
  122.             // It is required that at least one field changes if you are using doctrine
  123.             // otherwise the event listeners won't be called and the file is lost
  124.             $this->setUpdated(new \DateTimeImmutable());
  125.         }
  126.     }
  127.     public function getImageFile(): ?File
  128.     {
  129.         return $this->imageFile;
  130.     }
  131.     /**
  132.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $photoFile
  133.      */
  134.     public function setPhotoFile(?File $photoFile null): void
  135.     {
  136.         $this->photoFile $photoFile;
  137.         if (null !== $photoFile) {
  138.             // It is required that at least one field changes if you are using doctrine
  139.             // otherwise the event listeners won't be called and the file is lost
  140.             $this->setUpdated(new \DateTimeImmutable());
  141.         }
  142.     }
  143.     public function getPhotoFile(): ?File
  144.     {
  145.         return $this->photoFile;
  146.     }
  147.     public function getUser(): ?User
  148.     {
  149.         return $this->user;
  150.     }
  151.     public function setUser(?User $user): self
  152.     {
  153.         $this->user $user;
  154.         return $this;
  155.     }
  156.     public function isOnline(): ?bool
  157.     {
  158.         return $this->online;
  159.     }
  160.     public function setOnline(bool $online): self
  161.     {
  162.         $this->online $online;
  163.         return $this;
  164.     }
  165.     public function getAnneeExperience(): ?int
  166.     {
  167.         return $this->anneeExperience;
  168.     }
  169.     public function setAnneeExperience(?int $anneeExperience): self
  170.     {
  171.         $this->anneeExperience $anneeExperience;
  172.         return $this;
  173.     }
  174.     public function __toString()
  175.     {
  176.         return $this->getEmail();
  177.     }
  178.     public function getFonction(): ?string
  179.     {
  180.         return $this->fonction;
  181.     }
  182.     public function setFonction(?string $fonction): self
  183.     {
  184.         $this->fonction $fonction;
  185.         return $this;
  186.     }
  187.     public function getBureau(): ?string
  188.     {
  189.         return $this->bureau;
  190.     }
  191.     public function setBureau(?string $bureau): self
  192.     {
  193.         $this->bureau $bureau;
  194.         return $this;
  195.     }
  196.     public function getWhatsapp(): ?string
  197.     {
  198.         return $this->whatsapp;
  199.     }
  200.     public function setWhatsapp(?string $whatsapp): self
  201.     {
  202.         $this->whatsapp $whatsapp;
  203.         return $this;
  204.     }
  205.     /**
  206.      * @return Collection<int, Communaute>
  207.      */
  208.     public function getCommunautes(): Collection
  209.     {
  210.         return $this->communautes;
  211.     }
  212.     public function addCommunaute(Communaute $communaute): self
  213.     {
  214.         if (!$this->communautes->contains($communaute)) {
  215.             $this->communautes->add($communaute);
  216.             $communaute->setApropos($this);
  217.         }
  218.         return $this;
  219.     }
  220.     public function removeCommunaute(Communaute $communaute): self
  221.     {
  222.         if ($this->communautes->removeElement($communaute)) {
  223.             // set the owning side to null (unless already changed)
  224.             if ($communaute->getApropos() === $this) {
  225.                 $communaute->setApropos(null);
  226.             }
  227.         }
  228.         return $this;
  229.     }
  230.     public function getImage(): ?string
  231.     {
  232.         return $this->image;
  233.     }
  234.     public function setImage(?string $image): self
  235.     {
  236.         $this->image $image;
  237.         return $this;
  238.     }
  239.     public function getHistorique(): ?string
  240.     {
  241.         return $this->historique;
  242.     }
  243.     public function setHistorique(?string $historique): static
  244.     {
  245.         $this->historique $historique;
  246.         return $this;
  247.     }
  248.     public function getMission(): ?string
  249.     {
  250.         return $this->mission;
  251.     }
  252.     public function setMission(?string $mission): static
  253.     {
  254.         $this->mission $mission;
  255.         return $this;
  256.     }
  257.     public function getApproche(): ?string
  258.     {
  259.         return $this->approche;
  260.     }
  261.     public function setApproche(?string $approche): static
  262.     {
  263.         $this->approche $approche;
  264.         return $this;
  265.     }
  266.     public function getVision(): ?string
  267.     {
  268.         return $this->vision;
  269.     }
  270.     public function setVision(?string $vision): static
  271.     {
  272.         $this->vision $vision;
  273.         return $this;
  274.     }
  275.     public function getValeurs(): ?string
  276.     {
  277.         return $this->valeurs;
  278.     }
  279.     public function setValeurs(?string $valeurs): static
  280.     {
  281.         $this->valeurs $valeurs;
  282.         return $this;
  283.     }
  284. }