<?php
namespace App\Entity;
use App\Repository\TypologieActeurRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TypologieActeurRepository::class)
* @ORM\Table(name="co_typologie_acteur")
*/
class TypologieActeur
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=Contact::class, mappedBy="typologieActeur")
*/
private $contact;
public function __construct()
{
$this->contact = 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, Contact>
*/
public function getContact(): Collection
{
return $this->contact;
}
public function addContact(Contact $contact): self
{
if (!$this->contact->contains($contact)) {
$this->contact[] = $contact;
$contact->setTypologieActeur($this);
}
return $this;
}
public function removeContact(Contact $contact): self
{
if ($this->contact->removeElement($contact)) {
// set the owning side to null (unless already changed)
if ($contact->getTypologieActeur() === $this) {
$contact->setTypologieActeur(null);
}
}
return $this;
}
}