<?php
namespace App\Entity;
use App\Entity\Traits\TimestampableTrait;
use App\Repository\TblParcelleRepository;
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=TblParcelleRepository::class)
* @Gedmo\Loggable
*/
class TblParcelle
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Gedmo\Versioned
*/
private $parcelle;
/**
* @ORM\Column(type="integer", nullable=true)
* @Gedmo\Versioned
*/
private $surfaceHectare;
/**
* @ORM\ManyToMany(targetEntity=RefTypeProduit::class, inversedBy="parcelles")
*/
private $typeProduit;
/**
* @ORM\ManyToMany(targetEntity=TblMouvement::class, mappedBy="parcelle")
*/
private $mouvements;
/**
* @ORM\ManyToMany(targetEntity=TblOperations::class, mappedBy="parcelles")
*/
private $tblOperations;
/**
* @ORM\ManyToMany(targetEntity=TblOperationTravail::class, mappedBy="parcelle")
*/
private $tblOperationTravail;
/**
* @ORM\OneToMany(targetEntity=TblDetailQuantiteParcelle::class, mappedBy="parcelle")
*/
private $detailQuantiteParcelles;
use TimestampableTrait;
public function __construct()
{
$this->typeProduit = new ArrayCollection();
$this->mouvements = new ArrayCollection();
$this->tblOperations = new ArrayCollection();
$this->detailQuantiteParcelles = new ArrayCollection();
$this->tblOperationTravail = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getParcelle(): ?string
{
return $this->parcelle;
}
public function setParcelle(string $parcelle): self
{
$this->parcelle = $parcelle;
return $this;
}
public function getSurfaceHectare(): ?int
{
return $this->surfaceHectare;
}
public function setSurfaceHectare(?int $surfaceHectare): self
{
$this->surfaceHectare = $surfaceHectare;
return $this;
}
/**
* @return Collection<int, RefTypeProduit>
*/
public function getTypeProduit(): Collection
{
return $this->typeProduit;
}
public function addTypeProduit(RefTypeProduit $typeProduit): self
{
if (!$this->typeProduit->contains($typeProduit)) {
$this->typeProduit[] = $typeProduit;
}
return $this;
}
public function removeTypeProduit(RefTypeProduit $typeProduit): self
{
$this->typeProduit->removeElement($typeProduit);
return $this;
}
public function __toString()
{
return $this->getParcelle();
}
/**
* @return Collection<int, TblMouvement>
*/
public function getMouvements(): Collection
{
return $this->mouvements;
}
public function addMouvement(TblMouvement $mouvement): self
{
if (!$this->mouvements->contains($mouvement)) {
$this->mouvements[] = $mouvement;
$mouvement->addParcelle($this);
}
return $this;
}
public function removeMouvement(TblMouvement $mouvement): self
{
if ($this->mouvements->removeElement($mouvement)) {
$mouvement->removeParcelle($this);
}
return $this;
}
/**
* @return Collection<int, TblOperations>
*/
public function getTblOperations(): Collection
{
return $this->tblOperations;
}
public function addTblOperation(TblOperations $tblOperation): self
{
if (!$this->tblOperations->contains($tblOperation)) {
$this->tblOperations[] = $tblOperation;
$tblOperation->addParcelle($this);
}
return $this;
}
public function removeTblOperation(TblOperations $tblOperation): self
{
if ($this->tblOperations->removeElement($tblOperation)) {
$tblOperation->removeParcelle($this);
}
return $this;
}
/**
* @return Collection<int, TblDetailQuantiteParcelle>
*/
public function getDetailQuantiteParcelles(): Collection
{
return $this->detailQuantiteParcelles;
}
public function addDetailQuantiteParcelle(TblDetailQuantiteParcelle $detailQuantiteParcelle): self
{
if (!$this->detailQuantiteParcelles->contains($detailQuantiteParcelle)) {
$this->detailQuantiteParcelles[] = $detailQuantiteParcelle;
$detailQuantiteParcelle->setParcelle($this);
}
return $this;
}
public function removeDetailQuantiteParcelle(TblDetailQuantiteParcelle $detailQuantiteParcelle): self
{
if ($this->detailQuantiteParcelles->removeElement($detailQuantiteParcelle)) {
// set the owning side to null (unless already changed)
if ($detailQuantiteParcelle->getParcelle() === $this) {
$detailQuantiteParcelle->setParcelle(null);
}
}
return $this;
}
/**
* @return Collection<int, TblOperationTravail>
*/
public function getTblOperationTravail(): Collection
{
return $this->tblOperationTravail;
}
public function addTblOperationTravail(TblOperationTravail $tblOperationTravail): self
{
if (!$this->tblOperationTravail->contains($tblOperationTravail)) {
$this->tblOperationTravail[] = $tblOperationTravail;
$tblOperationTravail->addParcelle($this);
}
return $this;
}
public function removeTblOperationTravail(TblOperationTravail $tblOperationTravail): self
{
if ($this->tblOperationTravail->removeElement($tblOperationTravail)) {
$tblOperationTravail->removeParcelle($this);
}
return $this;
}
}