<?php
namespace App\Entity;
use App\Repository\RefVilleRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=RefVilleRepository::class)
* @Gedmo\Loggable
*/
class RefVille
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=50)
* @Gedmo\Versioned
*/
private $villeLib;
/**
* @ORM\OneToMany(targetEntity=TblOperationVente::class, mappedBy="destination")
*/
private $tblOperationVentes;
public function __construct()
{
$this->tblOperationVentes = new ArrayCollection();
}
public function __toString()
{
return $this->getVilleLib();
}
public function getId(): ?int
{
return $this->id;
}
public function getVilleLib(): ?string
{
return $this->villeLib;
}
public function setVilleLib(string $villeLib): self
{
$this->villeLib = $villeLib;
return $this;
}
/**
* @return Collection<int, TblOperationVente>
*/
public function getTblOperationVentes(): Collection
{
return $this->tblOperationVentes;
}
public function addTblOperationVente(TblOperationVente $tblOperationVente): self
{
if (!$this->tblOperationVentes->contains($tblOperationVente)) {
$this->tblOperationVentes[] = $tblOperationVente;
$tblOperationVente->setDestination($this);
}
return $this;
}
public function removeTblOperationVente(TblOperationVente $tblOperationVente): self
{
if ($this->tblOperationVentes->removeElement($tblOperationVente)) {
// set the owning side to null (unless already changed)
if ($tblOperationVente->getDestination() === $this) {
$tblOperationVente->setDestination(null);
}
}
return $this;
}
}