src/Entity/TblParcelle.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\TimestampableTrait;
  4. use App\Repository\TblParcelleRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. /**
  10.  * @ORM\Entity(repositoryClass=TblParcelleRepository::class)
  11.  * @Gedmo\Loggable
  12.  */
  13. class TblParcelle
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      * @Gedmo\Versioned
  24.      */
  25.     private $parcelle;
  26.     /**
  27.      * @ORM\Column(type="integer", nullable=true)
  28.      * @Gedmo\Versioned
  29.      */
  30.     private $surfaceHectare;
  31.     /**
  32.      * @ORM\ManyToMany(targetEntity=RefTypeProduit::class, inversedBy="parcelles")
  33.      */
  34.     private $typeProduit;
  35.     /**
  36.      * @ORM\ManyToMany(targetEntity=TblMouvement::class, mappedBy="parcelle")
  37.      */
  38.     private $mouvements;
  39.     /**
  40.      * @ORM\ManyToMany(targetEntity=TblOperations::class, mappedBy="parcelles")
  41.      */
  42.     private $tblOperations;
  43.     /**
  44.      * @ORM\ManyToMany(targetEntity=TblOperationTravail::class, mappedBy="parcelle")
  45.      */
  46.     private $tblOperationTravail;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=TblDetailQuantiteParcelle::class, mappedBy="parcelle")
  49.      */
  50.     private $detailQuantiteParcelles;
  51.     use TimestampableTrait;
  52.     public function __construct()
  53.     {
  54.         $this->typeProduit = new ArrayCollection();
  55.         $this->mouvements = new ArrayCollection();
  56.         $this->tblOperations = new ArrayCollection();
  57.         $this->detailQuantiteParcelles = new ArrayCollection();
  58.         $this->tblOperationTravail = new ArrayCollection();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getParcelle(): ?string
  65.     {
  66.         return $this->parcelle;
  67.     }
  68.     public function setParcelle(string $parcelle): self
  69.     {
  70.         $this->parcelle $parcelle;
  71.         return $this;
  72.     }
  73.     public function getSurfaceHectare(): ?int
  74.     {
  75.         return $this->surfaceHectare;
  76.     }
  77.     public function setSurfaceHectare(?int $surfaceHectare): self
  78.     {
  79.         $this->surfaceHectare $surfaceHectare;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return Collection<int, RefTypeProduit>
  84.      */
  85.     public function getTypeProduit(): Collection
  86.     {
  87.         return $this->typeProduit;
  88.     }
  89.     public function addTypeProduit(RefTypeProduit $typeProduit): self
  90.     {
  91.         if (!$this->typeProduit->contains($typeProduit)) {
  92.             $this->typeProduit[] = $typeProduit;
  93.         }
  94.         return $this;
  95.     }
  96.     public function removeTypeProduit(RefTypeProduit $typeProduit): self
  97.     {
  98.         $this->typeProduit->removeElement($typeProduit);
  99.         return $this;
  100.     }
  101.     
  102.     public function __toString()
  103.     {
  104.         return $this->getParcelle();
  105.     }
  106.     /**
  107.      * @return Collection<int, TblMouvement>
  108.      */
  109.     public function getMouvements(): Collection
  110.     {
  111.         return $this->mouvements;
  112.     }
  113.     public function addMouvement(TblMouvement $mouvement): self
  114.     {
  115.         if (!$this->mouvements->contains($mouvement)) {
  116.             $this->mouvements[] = $mouvement;
  117.             $mouvement->addParcelle($this);
  118.         }
  119.         return $this;
  120.     }
  121.     public function removeMouvement(TblMouvement $mouvement): self
  122.     {
  123.             if ($this->mouvements->removeElement($mouvement)) {
  124.                 $mouvement->removeParcelle($this);
  125.             }
  126.         return $this;
  127.     }
  128.     /**
  129.      * @return Collection<int, TblOperations>
  130.      */
  131.     public function getTblOperations(): Collection
  132.     {
  133.         return $this->tblOperations;
  134.     }
  135.     public function addTblOperation(TblOperations $tblOperation): self
  136.     {
  137.         if (!$this->tblOperations->contains($tblOperation)) {
  138.             $this->tblOperations[] = $tblOperation;
  139.             $tblOperation->addParcelle($this);
  140.         }
  141.         return $this;
  142.     }
  143.     public function removeTblOperation(TblOperations $tblOperation): self
  144.     {
  145.         if ($this->tblOperations->removeElement($tblOperation)) {
  146.             $tblOperation->removeParcelle($this);
  147.         }
  148.         return $this;
  149.     }
  150.     /**
  151.      * @return Collection<int, TblDetailQuantiteParcelle>
  152.      */
  153.     public function getDetailQuantiteParcelles(): Collection
  154.     {
  155.         return $this->detailQuantiteParcelles;
  156.     }
  157.     public function addDetailQuantiteParcelle(TblDetailQuantiteParcelle $detailQuantiteParcelle): self
  158.     {
  159.         if (!$this->detailQuantiteParcelles->contains($detailQuantiteParcelle)) {
  160.             $this->detailQuantiteParcelles[] = $detailQuantiteParcelle;
  161.             $detailQuantiteParcelle->setParcelle($this);
  162.         }
  163.         return $this;
  164.     }
  165.     public function removeDetailQuantiteParcelle(TblDetailQuantiteParcelle $detailQuantiteParcelle): self
  166.     {
  167.         if ($this->detailQuantiteParcelles->removeElement($detailQuantiteParcelle)) {
  168.             // set the owning side to null (unless already changed)
  169.             if ($detailQuantiteParcelle->getParcelle() === $this) {
  170.                 $detailQuantiteParcelle->setParcelle(null);
  171.             }
  172.         }
  173.         return $this;
  174.     }
  175.     /**
  176.      * @return Collection<int, TblOperationTravail>
  177.      */
  178.     public function getTblOperationTravail(): Collection
  179.     {
  180.         return $this->tblOperationTravail;
  181.     }
  182.     public function addTblOperationTravail(TblOperationTravail $tblOperationTravail): self
  183.     {
  184.         if (!$this->tblOperationTravail->contains($tblOperationTravail)) {
  185.             $this->tblOperationTravail[] = $tblOperationTravail;
  186.             $tblOperationTravail->addParcelle($this);
  187.         }
  188.         return $this;
  189.     }
  190.     public function removeTblOperationTravail(TblOperationTravail $tblOperationTravail): self
  191.     {
  192.         if ($this->tblOperationTravail->removeElement($tblOperationTravail)) {
  193.             $tblOperationTravail->removeParcelle($this);
  194.         }
  195.         return $this;
  196.     }
  197. }