<?php
namespace App\Entity;
use App\Repository\BusinessUnitRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=BusinessUnitRepository::class)
*/
class BusinessUnit
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $TitreFr;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $TitreEn;
/**
* @ORM\OneToMany(targetEntity=Jobs::class, mappedBy="BusinessUnit")
*/
private $jobs;
public function __toString(){
return $this->TitreFr;
}
public function __construct()
{
$this->jobs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitreFr(): ?string
{
return $this->TitreFr;
}
public function setTitreFr(?string $TitreFr): self
{
$this->TitreFr = $TitreFr;
return $this;
}
public function getTitreEn(): ?string
{
return $this->TitreEn;
}
public function setTitreEn(?string $TitreEn): self
{
$this->TitreEn = $TitreEn;
return $this;
}
/**
* @return Collection<int, Jobs>
*/
public function getJobs(): Collection
{
return $this->jobs;
}
public function addJob(Jobs $job): self
{
if (!$this->jobs->contains($job)) {
$this->jobs[] = $job;
$job->setBusinessUnit($this);
}
return $this;
}
public function removeJob(Jobs $job): self
{
if ($this->jobs->removeElement($job)) {
// set the owning side to null (unless already changed)
if ($job->getBusinessUnit() === $this) {
$job->setBusinessUnit(null);
}
}
return $this;
}
}