src/Entity/Groupe.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\GroupeRepository;
  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(repositoryClassGroupeRepository::class)]
  9. class Groupe
  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(length255nullabletrue)]
  18.     private ?string $address null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $city null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $zipCode null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $region null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $instagram null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $facebook null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $twitter null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $snapchat null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $tiktok null;
  35.     #[ORM\Column(length255nullabletrue)]
  36.     private ?string $youtube null;
  37.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  38.     private ?string $commentaire null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $bio null;
  41.     #[ORM\OneToMany(mappedBy'groupe'targetEntityGroupeMember::class, cascade: ['remove'],)]
  42.     private Collection $members;
  43.     #[ORM\Column]
  44.     private ?\DateTimeImmutable $createdAt null;
  45.     #[ORM\ManyToOne(inversedBy'groupes')]
  46.     private ?User $adminUser null;
  47.     #[ORM\OneToMany(mappedBy'groupe'targetEntityProgram::class)]
  48.     private Collection $programGroupe;
  49.     #[ORM\OneToMany(mappedBy'groupe'targetEntityProgramCandidate::class, cascade: ['remove'])]
  50.     private Collection $company;
  51.     #[ORM\OneToMany(mappedBy'groupe'targetEntityCandidateFile::class, cascade: ['persist''remove'])]
  52.     private Collection $files;
  53.     #[ORM\Column(length255nullabletrue)]
  54.     private ?string $createdBy null;
  55.     public function __construct()
  56.     {
  57.         $this->members = new ArrayCollection();
  58.         $this->programGroupe = new ArrayCollection();
  59.         $this->createdAt =  new \DateTimeImmutable();
  60.         $this->company = new ArrayCollection();
  61.         $this->files = new ArrayCollection();
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getName(): ?string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(string $name): self
  72.     {
  73.         $this->name $name;
  74.         return $this;
  75.     }
  76.     public function getAddress(): ?string
  77.     {
  78.         return $this->address;
  79.     }
  80.     public function setAddress(string $address): self
  81.     {
  82.         $this->address $address;
  83.         return $this;
  84.     }
  85.     public function getCity(): ?string
  86.     {
  87.         return $this->city;
  88.     }
  89.     public function setCity(string $city): self
  90.     {
  91.         $this->city $city;
  92.         return $this;
  93.     }
  94.     public function getZipCode(): ?string
  95.     {
  96.         return $this->zipCode;
  97.     }
  98.     public function setZipCode(string $zipCode): self
  99.     {
  100.         $this->zipCode $zipCode;
  101.         return $this;
  102.     }
  103.     public function getRegion(): ?string
  104.     {
  105.         return $this->region;
  106.     }
  107.     public function setRegion(string $region): self
  108.     {
  109.         $this->region $region;
  110.         return $this;
  111.     }
  112.     public function getInstagram(): ?string
  113.     {
  114.         return $this->instagram;
  115.     }
  116.     public function setInstagram(?string $instagram): self
  117.     {
  118.         $this->instagram $instagram;
  119.         return $this;
  120.     }
  121.     public function getFacebook(): ?string
  122.     {
  123.         return $this->facebook;
  124.     }
  125.     public function setFacebook(?string $facebook): self
  126.     {
  127.         $this->facebook $facebook;
  128.         return $this;
  129.     }
  130.     public function getTwitter(): ?string
  131.     {
  132.         return $this->twitter;
  133.     }
  134.     public function setTwitter(?string $twitter): self
  135.     {
  136.         $this->twitter $twitter;
  137.         return $this;
  138.     }
  139.     public function getSnapchat(): ?string
  140.     {
  141.         return $this->snapchat;
  142.     }
  143.     public function setSnapchat(?string $snapchat): self
  144.     {
  145.         $this->snapchat $snapchat;
  146.         return $this;
  147.     }
  148.     public function getTiktok(): ?string
  149.     {
  150.         return $this->tiktok;
  151.     }
  152.     public function setTiktok(?string $tiktok): self
  153.     {
  154.         $this->tiktok $tiktok;
  155.         return $this;
  156.     }
  157.     public function getYoutube(): ?string
  158.     {
  159.         return $this->youtube;
  160.     }
  161.     public function setYoutube(?string $youtube): self
  162.     {
  163.         $this->youtube $youtube;
  164.         return $this;
  165.     }
  166.     public function getCommentaire(): ?string
  167.     {
  168.         return $this->commentaire;
  169.     }
  170.     public function setCommentaire(string $commentaire): self
  171.     {
  172.         $this->commentaire $commentaire;
  173.         return $this;
  174.     }
  175.     public function getBio(): ?string
  176.     {
  177.         return $this->bio;
  178.     }
  179.     public function setBio(?string $bio): self
  180.     {
  181.         $this->bio $bio;
  182.         return $this;
  183.     }
  184.     /**
  185.      * @return Collection<int, GroupeMember>
  186.      */
  187.     public function getMembers(): Collection
  188.     {
  189.         return $this->members;
  190.     }
  191.     public function addMember(GroupeMember $member): self
  192.     {
  193.         if (!$this->members->contains($member)) {
  194.             $this->members->add($member);
  195.             $member->setGroupe($this);
  196.         }
  197.         return $this;
  198.     }
  199.     public function removeMember(GroupeMember $member): self
  200.     {
  201.         if ($this->members->removeElement($member)) {
  202.             // set the owning side to null (unless already changed)
  203.             if ($member->getGroupe() === $this) {
  204.                 $member->setGroupe(null);
  205.             }
  206.         }
  207.         return $this;
  208.     }
  209.     public function getCreatedAt(): ?\DateTimeImmutable
  210.     {
  211.         return $this->createdAt;
  212.     }
  213.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  214.     {
  215.         $this->createdAt $createdAt;
  216.         return $this;
  217.     }
  218.     public function getAdminUser(): ?User
  219.     {
  220.         return $this->adminUser;
  221.     }
  222.     public function setAdminUser(?User $adminUser): self
  223.     {
  224.         $this->adminUser $adminUser;
  225.         return $this;
  226.     }
  227.     /**
  228.      * @return Collection<int, Program>
  229.      */
  230.     public function getProgramGroupe(): Collection
  231.     {
  232.         return $this->programGroupe;
  233.     }
  234.     public function addProgramGroupe(Program $programGroupe): self
  235.     {
  236.         if (!$this->programGroupe->contains($programGroupe)) {
  237.             $this->programGroupe->add($programGroupe);
  238.             $programGroupe->setGroupe($this);
  239.         }
  240.         return $this;
  241.     }
  242.     public function removeProgramGroupe(Program $programGroupe): self
  243.     {
  244.         if ($this->programGroupe->removeElement($programGroupe)) {
  245.             // set the owning side to null (unless already changed)
  246.             if ($programGroupe->getGroupe() === $this) {
  247.                 $programGroupe->setGroupe(null);
  248.             }
  249.         }
  250.         return $this;
  251.     }
  252.     public function __toString()
  253.     {
  254.         return $this->name;
  255.     }
  256.     public function totalMembers()
  257.     {
  258.         $total count($this->members);
  259.         return $total;
  260.     }
  261.     /**
  262.      * @return Collection<int, ProgramCandidate>
  263.      */
  264.     public function getCompany(): Collection
  265.     {
  266.         return $this->company;
  267.     }
  268.     public function addCompany(ProgramCandidate $company): self
  269.     {
  270.         if (!$this->company->contains($company)) {
  271.             $this->company->add($company);
  272.             $company->setGroupe($this);
  273.         }
  274.         return $this;
  275.     }
  276.     public function removeCompany(ProgramCandidate $company): self
  277.     {
  278.         if ($this->company->removeElement($company)) {
  279.             // set the owning side to null (unless already changed)
  280.             if ($company->getGroupe() === $this) {
  281.                 $company->setGroupe(null);
  282.             }
  283.         }
  284.         return $this;
  285.     }
  286.     /**
  287.      * @return Collection<int, CandidateFile>
  288.      */
  289.     public function getFiles(): Collection
  290.     {
  291.         return $this->files;
  292.     }
  293.     public function addFile(CandidateFile $file): self
  294.     {
  295.         if (!$this->files->contains($file)) {
  296.             $this->files->add($file);
  297.             $file->setGroupe($this);
  298.         }
  299.         return $this;
  300.     }
  301.     public function removeFile(CandidateFile $file): self
  302.     {
  303.         if ($this->files->removeElement($file)) {
  304.             // set the owning side to null (unless already changed)
  305.             if ($file->getGroupe() === $this) {
  306.                 $file->setGroupe(null);
  307.             }
  308.         }
  309.         return $this;
  310.     }
  311.     public function getCreatedBy(): ?string
  312.     {
  313.         return $this->createdBy;
  314.     }
  315.     public function setCreatedBy(string $createdBy): self
  316.     {
  317.         $this->createdBy $createdBy;
  318.         return $this;
  319.     }
  320. }