src/Entity/RefVille.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RefVilleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity(repositoryClass=RefVilleRepository::class)
  10.  * @Gedmo\Loggable
  11.  */
  12. class RefVille
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=50)
  22.      * @Gedmo\Versioned
  23.      */
  24.     private $villeLib;
  25.     /**
  26.      * @ORM\OneToMany(targetEntity=TblOperationVente::class, mappedBy="destination")
  27.      */
  28.     private $tblOperationVentes;
  29.     public function __construct()
  30.     {
  31.         $this->tblOperationVentes = new ArrayCollection();
  32.     }
  33.     public function __toString()
  34.     {
  35.         return $this->getVilleLib();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getVilleLib(): ?string
  42.     {
  43.         return $this->villeLib;
  44.     }
  45.     public function setVilleLib(string $villeLib): self
  46.     {
  47.         $this->villeLib $villeLib;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, TblOperationVente>
  52.      */
  53.     public function getTblOperationVentes(): Collection
  54.     {
  55.         return $this->tblOperationVentes;
  56.     }
  57.     public function addTblOperationVente(TblOperationVente $tblOperationVente): self
  58.     {
  59.         if (!$this->tblOperationVentes->contains($tblOperationVente)) {
  60.             $this->tblOperationVentes[] = $tblOperationVente;
  61.             $tblOperationVente->setDestination($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeTblOperationVente(TblOperationVente $tblOperationVente): self
  66.     {
  67.         if ($this->tblOperationVentes->removeElement($tblOperationVente)) {
  68.             // set the owning side to null (unless already changed)
  69.             if ($tblOperationVente->getDestination() === $this) {
  70.                 $tblOperationVente->setDestination(null);
  71.             }
  72.         }
  73.         return $this;
  74.     }
  75. }