src/Entity/Company.php line 12
<?php
namespace App\Entity;
use App\Repository\CompanyRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CompanyRepository::class)]
class Company
{
#[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 $type = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $siretNumber = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $phone = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address = 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 $youtube = 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 $contactName = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $contactFirstname = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $contactEmail = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $contactRole = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $contactPhone = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $informations = null;
#[ORM\ManyToOne(inversedBy: 'companies')]
private ?User $adminUser = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\OneToMany(mappedBy: 'company', targetEntity: Program::class)]
private Collection $programCompany;
#[ORM\OneToMany(mappedBy: 'company', targetEntity: ProgramCandidate::class, cascade: ['remove'])]
private Collection $programCandidates;
#[ORM\OneToMany(mappedBy: 'company', targetEntity: CandidateFile::class, cascade: ['persist', 'remove'])]
private Collection $files;
#[ORM\Column(length: 255)]
private ?string $createdBy = null;
public function __construct()
{
$this->programCompany = new ArrayCollection();
$this->createdAt = new \DateTimeImmutable();
$this->programCandidates = 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 getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getSiretNumber(): ?string
{
return $this->siretNumber;
}
public function setSiretNumber(string $siretNumber): self
{
$this->siretNumber = $siretNumber;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
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 getYoutube(): ?string
{
return $this->youtube;
}
public function setYoutube(?string $youtube): self
{
$this->youtube = $youtube;
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 getContactName(): ?string
{
return $this->contactName;
}
public function setContactName(string $contactName): self
{
$this->contactName = $contactName;
return $this;
}
public function getContactFirstname(): ?string
{
return $this->contactFirstname;
}
public function setContactFirstname(string $contactFirstname): self
{
$this->contactFirstname = $contactFirstname;
return $this;
}
public function getContactEmail(): ?string
{
return $this->contactEmail;
}
public function setContactEmail(string $contactEmail): self
{
$this->contactEmail = $contactEmail;
return $this;
}
public function getContactRole(): ?string
{
return $this->contactRole;
}
public function setContactRole(?string $contactRole): self
{
$this->contactRole = $contactRole;
return $this;
}
public function getContactPhone(): ?string
{
return $this->contactPhone;
}
public function setContactPhone(string $contactPhone): self
{
$this->contactPhone = $contactPhone;
return $this;
}
public function getInformations(): ?string
{
return $this->informations;
}
public function setInformations(?string $informations): self
{
$this->informations = $informations;
return $this;
}
public function getAdminUser(): ?User
{
return $this->adminUser;
}
public function setAdminUser(?User $adminUser): self
{
$this->adminUser = $adminUser;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection<int, Program>
*/
public function getProgramCompany(): Collection
{
return $this->programCompany;
}
public function addProgramCompany(Program $programCompany): self
{
if (!$this->programCompany->contains($programCompany)) {
$this->programCompany->add($programCompany);
$programCompany->setCompany($this);
}
return $this;
}
public function removeProgramCompany(Program $programCompany): self
{
if ($this->programCompany->removeElement($programCompany)) {
// set the owning side to null (unless already changed)
if ($programCompany->getCompany() === $this) {
$programCompany->setCompany(null);
}
}
return $this;
}
/**
* @return Collection<int, ProgramCandidate>
*/
public function getProgramCandidates(): Collection
{
return $this->programCandidates;
}
public function addProgramCandidate(ProgramCandidate $programCandidate): self
{
if (!$this->programCandidates->contains($programCandidate)) {
$this->programCandidates->add($programCandidate);
$programCandidate->setCompany($this);
}
return $this;
}
public function removeProgramCandidate(ProgramCandidate $programCandidate): self
{
if ($this->programCandidates->removeElement($programCandidate)) {
// set the owning side to null (unless already changed)
if ($programCandidate->getCompany() === $this) {
$programCandidate->setCompany(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
/**
* @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->setCompany($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->getCompany() === $this) {
$file->setCompany(null);
}
}
return $this;
}
public function getCreatedBy(): ?string
{
return $this->createdBy;
}
public function setCreatedBy(string $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
}