<?php
namespace App\Entity;
use App\Repository\AgenceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AgenceRepository::class)]
class Agence
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $nom;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $adresse;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $boitePostale;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $codePostal;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $ville;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $telephone;
#[ORM\OneToMany(targetEntity: User::class, mappedBy: 'agence')]
private $users;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $siret;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $codeAPE;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $tvaIntracommunautaire;
public function __toString()
{
return $this->getNom();
}
public function __construct()
{
$this->users = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(?string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getBoitePostale(): ?string
{
return $this->boitePostale;
}
public function setBoitePostale(?string $boitePostale): self
{
$this->boitePostale = $boitePostale;
return $this;
}
public function getCodePostal(): ?string
{
return $this->codePostal;
}
public function setCodePostal(?string $codePostal): self
{
$this->codePostal = $codePostal;
return $this;
}
public function getVille(): ?string
{
return $this->ville;
}
public function setVille(?string $ville): self
{
$this->ville = $ville;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
/**
* @return Collection|User[]
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setAgence($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getAgence() === $this) {
$user->setAgence(null);
}
}
return $this;
}
public function getSiret(): ?string
{
return $this->siret;
}
public function setSiret(?string $siret): self
{
$this->siret = $siret;
return $this;
}
public function getCodeAPE(): ?string
{
return $this->codeAPE;
}
public function setCodeAPE(?string $codeAPE): self
{
$this->codeAPE = $codeAPE;
return $this;
}
public function getTvaIntracommunautaire(): ?string
{
return $this->tvaIntracommunautaire;
}
public function setTvaIntracommunautaire(?string $tvaIntracommunautaire): self
{
$this->tvaIntracommunautaire = $tvaIntracommunautaire;
return $this;
}
}