<?php
namespace App\Entity;
use App\Repository\AdresseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AdresseRepository::class)
*/
class Adresse
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $lot;
/**
* @ORM\ManyToOne(targetEntity=Quartier::class, inversedBy="adresses")
*/
private $quartier;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="adresses")
*/
private $patient;
/**
* @ORM\Column(type="string", length=255)
*/
private $titre;
/**
* @ORM\OneToOne(targetEntity=IctusPharmacie::class, cascade={"persist", "remove"})
*/
private $ictusPharmacie;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $longitude;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $latitude;
/**
* @ORM\OneToMany(targetEntity=Parcours::class, mappedBy="adresse")
*/
private $parcours;
/**
* @ORM\OneToMany(targetEntity=IctusCommande::class, mappedBy="adressePatient")
*/
private $ictusCommandes;
public function __construct()
{
$this->parcours = new ArrayCollection();
$this->ictusCommandes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLot(): ?string
{
return $this->lot;
}
public function setLot(string $lot): self
{
$this->lot = $lot;
return $this;
}
public function getQuartier(): ?Quartier
{
return $this->quartier;
}
public function setQuartier(?Quartier $quartier): self
{
$this->quartier = $quartier;
return $this;
}
public function getPatient(): ?User
{
return $this->patient;
}
public function setPatient(?User $patient): self
{
$this->patient = $patient;
return $this;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getIctusPharmacie(): ?IctusPharmacie
{
return $this->ictusPharmacie;
}
public function setIctusPharmacie(?IctusPharmacie $ictusPharmacie): self
{
$this->ictusPharmacie = $ictusPharmacie;
return $this;
}
public function getLatitude(): ?float
{
return $this->latitude;
}
public function setLatitude(?float $latitude): self
{
$this->latitude = $latitude;
return $this;
}
public function getLongitude(): ?float
{
return $this->longitude;
}
public function setLongitude(?float $longitude): self
{
$this->longitude = $longitude;
return $this;
}
/**
* @return Collection<int, Parcours>
*/
public function getParcours(): Collection
{
return $this->parcours;
}
public function addParcour(Parcours $parcour): self
{
if (!$this->parcours->contains($parcour)) {
$this->parcours[] = $parcour;
$parcour->setAdresse($this);
}
return $this;
}
public function removeParcour(Parcours $parcour): self
{
if ($this->parcours->removeElement($parcour)) {
// set the owning side to null (unless already changed)
if ($parcour->getAdresse() === $this) {
$parcour->setAdresse(null);
}
}
return $this;
}
/**
* @return Collection<int, IctusCommande>
*/
public function getIctusCommandes(): Collection
{
return $this->ictusCommandes;
}
public function addIctusCommande(IctusCommande $ictusCommande): self
{
if (!$this->ictusCommandes->contains($ictusCommande)) {
$this->ictusCommandes[] = $ictusCommande;
$ictusCommande->setAdressePatient($this);
}
return $this;
}
public function removeIctusCommande(IctusCommande $ictusCommande): self
{
if ($this->ictusCommandes->removeElement($ictusCommande)) {
// set the owning side to null (unless already changed)
if ($ictusCommande->getAdressePatient() === $this) {
$ictusCommande->setAdressePatient(null);
}
}
return $this;
}
}