src/Entity/Groupe.php line 12
<?php
namespace App\Entity;
use App\Repository\GroupeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: GroupeRepository::class)]
class Groupe
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $zipCode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $region = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $instagram = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $facebook = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $twitter = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $snapchat = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $tiktok = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $youtube = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $commentaire = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $bio = null;
#[ORM\OneToMany(mappedBy: 'groupe', targetEntity: GroupeMember::class, cascade: ['remove'],)]
private Collection $members;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\ManyToOne(inversedBy: 'groupes')]
private ?User $adminUser = null;
#[ORM\OneToMany(mappedBy: 'groupe', targetEntity: Program::class)]
private Collection $programGroupe;
#[ORM\OneToMany(mappedBy: 'groupe', targetEntity: ProgramCandidate::class, cascade: ['remove'])]
private Collection $company;
#[ORM\OneToMany(mappedBy: 'groupe', targetEntity: CandidateFile::class, cascade: ['persist', 'remove'])]
private Collection $files;
#[ORM\Column(length: 255, nullable: true)]
private ?string $createdBy = null;
public function __construct()
{
$this->members = new ArrayCollection();
$this->programGroupe = new ArrayCollection();
$this->createdAt = new \DateTimeImmutable();
$this->company = new ArrayCollection();
$this->files = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city): self
{
$this->city = $city;
return $this;
}
public function getZipCode(): ?string
{
return $this->zipCode;
}
public function setZipCode(string $zipCode): self
{
$this->zipCode = $zipCode;
return $this;
}
public function getRegion(): ?string
{
return $this->region;
}
public function setRegion(string $region): self
{
$this->region = $region;
return $this;
}
public function getInstagram(): ?string
{
return $this->instagram;
}
public function setInstagram(?string $instagram): self
{
$this->instagram = $instagram;
return $this;
}
public function getFacebook(): ?string
{
return $this->facebook;
}
public function setFacebook(?string $facebook): self
{
$this->facebook = $facebook;
return $this;
}
public function getTwitter(): ?string
{
return $this->twitter;
}
public function setTwitter(?string $twitter): self
{
$this->twitter = $twitter;
return $this;
}
public function getSnapchat(): ?string
{
return $this->snapchat;
}
public function setSnapchat(?string $snapchat): self
{
$this->snapchat = $snapchat;
return $this;
}
public function getTiktok(): ?string
{
return $this->tiktok;
}
public function setTiktok(?string $tiktok): self
{
$this->tiktok = $tiktok;
return $this;
}
public function getYoutube(): ?string
{
return $this->youtube;
}
public function setYoutube(?string $youtube): self
{
$this->youtube = $youtube;
return $this;
}
public function getCommentaire(): ?string
{
return $this->commentaire;
}
public function setCommentaire(string $commentaire): self
{
$this->commentaire = $commentaire;
return $this;
}
public function getBio(): ?string
{
return $this->bio;
}
public function setBio(?string $bio): self
{
$this->bio = $bio;
return $this;
}
/**
* @return Collection<int, GroupeMember>
*/
public function getMembers(): Collection
{
return $this->members;
}
public function addMember(GroupeMember $member): self
{
if (!$this->members->contains($member)) {
$this->members->add($member);
$member->setGroupe($this);
}
return $this;
}
public function removeMember(GroupeMember $member): self
{
if ($this->members->removeElement($member)) {
// set the owning side to null (unless already changed)
if ($member->getGroupe() === $this) {
$member->setGroupe(null);
}
}
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getAdminUser(): ?User
{
return $this->adminUser;
}
public function setAdminUser(?User $adminUser): self
{
$this->adminUser = $adminUser;
return $this;
}
/**
* @return Collection<int, Program>
*/
public function getProgramGroupe(): Collection
{
return $this->programGroupe;
}
public function addProgramGroupe(Program $programGroupe): self
{
if (!$this->programGroupe->contains($programGroupe)) {
$this->programGroupe->add($programGroupe);
$programGroupe->setGroupe($this);
}
return $this;
}
public function removeProgramGroupe(Program $programGroupe): self
{
if ($this->programGroupe->removeElement($programGroupe)) {
// set the owning side to null (unless already changed)
if ($programGroupe->getGroupe() === $this) {
$programGroupe->setGroupe(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
public function totalMembers()
{
$total = count($this->members);
return $total;
}
/**
* @return Collection<int, ProgramCandidate>
*/
public function getCompany(): Collection
{
return $this->company;
}
public function addCompany(ProgramCandidate $company): self
{
if (!$this->company->contains($company)) {
$this->company->add($company);
$company->setGroupe($this);
}
return $this;
}
public function removeCompany(ProgramCandidate $company): self
{
if ($this->company->removeElement($company)) {
// set the owning side to null (unless already changed)
if ($company->getGroupe() === $this) {
$company->setGroupe(null);
}
}
return $this;
}
/**
* @return Collection<int, CandidateFile>
*/
public function getFiles(): Collection
{
return $this->files;
}
public function addFile(CandidateFile $file): self
{
if (!$this->files->contains($file)) {
$this->files->add($file);
$file->setGroupe($this);
}
return $this;
}
public function removeFile(CandidateFile $file): self
{
if ($this->files->removeElement($file)) {
// set the owning side to null (unless already changed)
if ($file->getGroupe() === $this) {
$file->setGroupe(null);
}
}
return $this;
}
public function getCreatedBy(): ?string
{
return $this->createdBy;
}
public function setCreatedBy(string $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
}