<?php
namespace App\Entity;
use App\Repository\ProfessionalTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ProfessionalTypeRepository::class)
*/
class ProfessionalType
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\ManyToMany(targetEntity="Transporteur", mappedBy="professionalType")
*/
private $transporteurs;
/**
* @ORM\Column(type="json")
*/
private $modulesAssocies = [];
public function __construct()
{
$this->transporteurs = 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;
}
/**
* @return Collection<int, Transporteur>
*/
public function getTransporteurs(): Collection
{
return $this->transporteurs;
}
public function addTransporteur(Transporteur $transporteur): self
{
if (!$this->transporteurs->contains($transporteur)) {
$this->transporteurs[] = $transporteur;
$transporteur->addProfessionalType($this);
}
return $this;
}
public function removeTransporteur(Transporteur $transporteur): self
{
if ($this->transporteurs->removeElement($transporteur)) {
$transporteur->removeProfessionalType($this);
}
return $this;
}
public function getModulesAssocies(): ?array
{
return $this->modulesAssocies;
}
public function setModulesAssocies(array $modulesAssocies): self
{
$this->modulesAssocies = $modulesAssocies ?: [];
return $this;
}
}