<?php
namespace App\Entity;
use App\Entity\Category;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Sulu\Bundle\ContactBundle\Entity\Contact as SuluContact;
use JMS\Serializer\Annotation\ExclusionPolicy;
/**
* @ORM\Entity()
* @ORM\Table(name="co_contacts")
* @ExclusionPolicy("all")
*/
class Contact extends SuluContact
{
/**
* @ORM\Column(type="boolean")
*/
private ?bool $visibleAnnuaire = true;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $freeText;
/**
* @ORM\ManyToOne(targetEntity=TypologieActeur::class, inversedBy="contact")
*/
private $typologieActeur;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $autresTypologieActeur;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $structure;
/**
* @ORM\ManyToOne(targetEntity=TypologieStructure::class, inversedBy="contact")
*/
private $typologieStructure;
/**
* @ORM\ManyToOne(targetEntity=Category::class, inversedBy="contacts")
*/
private $departement;
/**
* @ORM\ManyToOne(targetEntity=Category::class, inversedBy="territoireContacts")
*/
private $territoireInterv;
/**
* @ORM\ManyToMany(targetEntity=Category::class, inversedBy="optinsContacts")
*/
private $optins;
public function __construct()
{
parent::__construct();
$this->optins = new ArrayCollection();
}
public function getVisibleAnnuaire(): ?bool
{
return $this->visibleAnnuaire;
}
public function setVisibleAnnuaire(?bool $visibleAnnuaire): void
{
$this->visibleAnnuaire = $visibleAnnuaire;
}
public function getFreeText(): ?string
{
return $this->freeText;
}
public function setFreeText(?string $freeText): void
{
$this->freeText = $freeText;
}
public function getTypologieActeur(): ?TypologieActeur
{
return $this->typologieActeur;
}
public function setTypologieActeur(?TypologieActeur $typologieActeur): self
{
$this->typologieActeur = $typologieActeur;
return $this;
}
public function getAutresTypologieActeur(): ?string
{
return $this->autresTypologieActeur;
}
public function setAutresTypologieActeur(?string $autresTypologieActeur): self
{
$this->autresTypologieActeur = $autresTypologieActeur;
return $this;
}
public function getStructure(): ?string
{
return $this->structure;
}
public function setStructure(?string $structure): self
{
$this->structure = $structure;
return $this;
}
public function getTypologieStructure(): ?TypologieStructure
{
return $this->typologieStructure;
}
public function setTypologieStructure(?TypologieStructure $typologieStructure): self
{
$this->typologieStructure = $typologieStructure;
return $this;
}
public function getDepartement(): ?Category
{
return $this->departement;
}
public function setDepartement(?Category $departement): self
{
$this->departement = $departement;
return $this;
}
public function getTerritoireInterv(): ?Category
{
return $this->territoireInterv;
}
public function setTerritoireInterv(?Category $territoireInterv): self
{
$this->territoireInterv = $territoireInterv;
return $this;
}
/**
* @return Collection<int, Category>
*/
public function getOptins(): Collection
{
return $this->optins;
}
public function addOptin(Category $optin): self
{
if (!$this->optins->contains($optin)) {
$this->optins[] = $optin;
}
return $this;
}
public function removeOptin(Category $optin): self
{
$this->optins->removeElement($optin);
return $this;
}
}