<?php
namespace App\Entity;
use App\Repository\EntrepriseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=EntrepriseRepository::class)
* @UniqueEntity(
* fields={"email"},
* message="Ce mail est déjà utilisé."
* )
* @UniqueEntity(fields={"telephone"},message="Ce téléphone est déjà utilisé." )
* @UniqueEntity(fields={"wording"},message="Cette raison sociale est déjà utilisée." )
*/
class Entreprise
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="text")
*/
private $wording;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $siret;
/**
* @ORM\OneToMany(targetEntity=Inscrit::class, mappedBy="entreprise")
*/
private $inscrits;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $address;
/**
* @ORM\Column(type="string", length=255,nullable=true)
* @Assert\Email(message = "L'email '{{ value }}' n'est pas valide.")
*/
private $email;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Length(min=8,minMessage = "La taille minimum doit être de {{ limit }} caractères")
*/
private $telephone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $contact;
/**
* @ORM\Column(type="string", length=20, nullable=true)
* @Assert\Length(min=8,minMessage = "La taille minimum doit être de {{ limit }} caractères")
*/
private $contacttelephone;
/**
* @ORM\OneToMany(targetEntity=Financement::class, mappedBy="entreprise")
*/
private $financements;
/**
* @ORM\OneToMany(targetEntity=ReglementEntreprise::class, mappedBy="entreprise")
*/
private $reglementEntreprises;
/**
* @ORM\OneToMany(targetEntity=EnteteConvention::class, mappedBy="entreprise")
*/
private $enteteConventions;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $representant;
/**
* @ORM\OneToMany(targetEntity=DemandeLite::class, mappedBy="entreprise")
*/
private $demandeLites;
/**
* @ORM\OneToMany(targetEntity=EnteteFacture::class, mappedBy="entreprise")
*/
private $enteteFactures;
/**
* @ORM\OneToMany(targetEntity=DemandePro::class, mappedBy="entreprise")
*/
private $demandePros;
public function __construct()
{
$this->inscrits = new ArrayCollection();
$this->financements = new ArrayCollection();
$this->reglementEntreprises = new ArrayCollection();
$this->enteteConventions = new ArrayCollection();
$this->demandeLites = new ArrayCollection();
$this->enteteFactures = new ArrayCollection();
$this->demandePros = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getWording(): ?string
{
return $this->wording;
}
public function setWording(string $wording): self
{
$this->wording = $wording;
return $this;
}
public function getSiret(): ?string
{
return $this->siret;
}
public function setSiret(?string $siret): self
{
$this->siret = $siret;
return $this;
}
/**
* @return Collection<int, Inscrit>
*/
public function getInscrits(): Collection
{
return $this->inscrits;
}
public function addInscrit(Inscrit $inscrit): self
{
if (!$this->inscrits->contains($inscrit)) {
$this->inscrits[] = $inscrit;
$inscrit->setEntreprise($this);
}
return $this;
}
public function removeInscrit(Inscrit $inscrit): self
{
if ($this->inscrits->removeElement($inscrit)) {
// set the owning side to null (unless already changed)
if ($inscrit->getEntreprise() === $this) {
$inscrit->setEntreprise(null);
}
}
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
public function getContact(): ?string
{
return $this->contact;
}
public function setContact(?string $contact): self
{
$this->contact = $contact;
return $this;
}
public function getContacttelephone(): ?string
{
return $this->contacttelephone;
}
public function setContacttelephone(?string $contacttelephone): self
{
$this->contacttelephone = $contacttelephone;
return $this;
}
/**
* @return Collection<int, Financement>
*/
public function getFinancements(): Collection
{
return $this->financements;
}
public function addFinancement(Financement $financement): self
{
if (!$this->financements->contains($financement)) {
$this->financements[] = $financement;
$financement->setEntreprise($this);
}
return $this;
}
public function removeFinancement(Financement $financement): self
{
if ($this->financements->removeElement($financement)) {
// set the owning side to null (unless already changed)
if ($financement->getEntreprise() === $this) {
$financement->setEntreprise(null);
}
}
return $this;
}
/**
* @return Collection<int, ReglementEntreprise>
*/
public function getReglementEntreprises(): Collection
{
return $this->reglementEntreprises;
}
public function addReglementEntreprise(ReglementEntreprise $reglementEntreprise): self
{
if (!$this->reglementEntreprises->contains($reglementEntreprise)) {
$this->reglementEntreprises[] = $reglementEntreprise;
$reglementEntreprise->setEntreprise($this);
}
return $this;
}
public function removeReglementEntreprise(ReglementEntreprise $reglementEntreprise): self
{
if ($this->reglementEntreprises->removeElement($reglementEntreprise)) {
// set the owning side to null (unless already changed)
if ($reglementEntreprise->getEntreprise() === $this) {
$reglementEntreprise->setEntreprise(null);
}
}
return $this;
}
/**
* @return Collection<int, EnteteConvention>
*/
public function getEnteteConventions(): Collection
{
return $this->enteteConventions;
}
public function addEnteteConvention(EnteteConvention $enteteConvention): self
{
if (!$this->enteteConventions->contains($enteteConvention)) {
$this->enteteConventions[] = $enteteConvention;
$enteteConvention->setEntreprise($this);
}
return $this;
}
public function removeEnteteConvention(EnteteConvention $enteteConvention): self
{
if ($this->enteteConventions->removeElement($enteteConvention)) {
// set the owning side to null (unless already changed)
if ($enteteConvention->getEntreprise() === $this) {
$enteteConvention->setEntreprise(null);
}
}
return $this;
}
public function getRepresentant(): ?string
{
return $this->representant;
}
public function setRepresentant(?string $representant): self
{
$this->representant = $representant;
return $this;
}
/**
* @return Collection<int, DemandeLite>
*/
public function getDemandeLites(): Collection
{
return $this->demandeLites;
}
public function addDemandeLite(DemandeLite $demandeLite): self
{
if (!$this->demandeLites->contains($demandeLite)) {
$this->demandeLites[] = $demandeLite;
$demandeLite->setEntreprise($this);
}
return $this;
}
public function removeDemandeLite(DemandeLite $demandeLite): self
{
if ($this->demandeLites->removeElement($demandeLite)) {
// set the owning side to null (unless already changed)
if ($demandeLite->getEntreprise() === $this) {
$demandeLite->setEntreprise(null);
}
}
return $this;
}
/**
* @return Collection<int, EnteteFacture>
*/
public function getEnteteFactures(): Collection
{
return $this->enteteFactures;
}
public function addEnteteFacture(EnteteFacture $enteteFacture): self
{
if (!$this->enteteFactures->contains($enteteFacture)) {
$this->enteteFactures[] = $enteteFacture;
$enteteFacture->setEntreprise($this);
}
return $this;
}
public function removeEnteteFacture(EnteteFacture $enteteFacture): self
{
if ($this->enteteFactures->removeElement($enteteFacture)) {
// set the owning side to null (unless already changed)
if ($enteteFacture->getEntreprise() === $this) {
$enteteFacture->setEntreprise(null);
}
}
return $this;
}
/**
* @return Collection<int, DemandePro>
*/
public function getDemandePros(): Collection
{
return $this->demandePros;
}
public function addDemandePro(DemandePro $demandePro): self
{
if (!$this->demandePros->contains($demandePro)) {
$this->demandePros[] = $demandePro;
$demandePro->setEntreprise($this);
}
return $this;
}
public function removeDemandePro(DemandePro $demandePro): self
{
if ($this->demandePros->removeElement($demandePro)) {
// set the owning side to null (unless already changed)
if ($demandePro->getEntreprise() === $this) {
$demandePro->setEntreprise(null);
}
}
return $this;
}
}