<?php
namespace App\Entity;
use App\Repository\TmpReceptionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TmpReceptionRepository::class)
*/
class TmpReception
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=15)
*/
private $volume;
/**
* @ORM\Column(type="string", length=15)
*/
private $tonne;
/**
* @ORM\Column(type="boolean")
*/
private $isflag;
/**
* @ORM\Column(type="string", length=10)
*/
private $unite;
/**
* @ORM\Column(type="string", length=255)
*/
private $nature;
/**
* @ORM\Column(type="string", length=255)
*/
private $classementdepot;
/**
* @ORM\Column(type="string", length=10)
*/
private $quantite;
/**
* @ORM\Column(type="string", length=100)
*/
private $flutterid;
/**
* @ORM\ManyToOne(targetEntity=Reception::class, inversedBy="tmpReceptions", cascade={"persist", "remove"})
*/
private $reception;
/**
* @ORM\ManyToOne(targetEntity=utilisateur::class, inversedBy="tmpReceptions")
*/
private $user;
/**
* @ORM\OneToMany(targetEntity=TmpConteneurReception::class, mappedBy="tmpReception")
*/
private $tmpConteneurReceptions;
private $totalLoaded;
public function __construct()
{
$this->tmpConteneurReceptions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNature(): ?string
{
return $this->nature;
}
public function setNature(string $nature): self
{
$this->nature = $nature;
return $this;
}
public function getFlutterid(): ?string
{
return $this->flutterid;
}
public function setFlutterid(string $flutterid): self
{
$this->flutterid = $flutterid;
return $this;
}
public function getQuantite(): ?string
{
return $this->quantite;
}
public function setQuantite(string $quantite): self
{
$this->quantite = $quantite;
return $this;
}
public function getVolume(): ?string
{
return $this->volume;
}
public function setVolume(string $volume): self
{
$this->volume = $volume;
return $this;
}
public function getTonne(): ?string
{
return $this->tonne;
}
public function setTonne(string $tonne): self
{
$this->tonne = $tonne;
return $this;
}
public function isIsflag(): ?bool
{
return $this->isflag;
}
public function setIsflag(bool $isflag): self
{
$this->isflag = $isflag;
return $this;
}
public function getUnite(): ?string
{
return $this->unite;
}
public function setUnite(string $unite): self
{
$this->unite = $unite;
return $this;
}
public function getReception(): ?Reception
{
return $this->reception;
}
public function setReception(?Reception $reception): self
{
$this->reception = $reception;
return $this;
}
public function getUser(): ?utilisateur
{
return $this->user;
}
public function setUser(?utilisateur $user): self
{
$this->user = $user;
return $this;
}
/**
* @return mixed
*/
public function getClassementdepot(): string
{
return $this->classementdepot;
}
/**
* @param mixed $classementdepot
*/
public function setClassementdepot(string $classementdepot): self
{
$this->classementdepot = $classementdepot;
return $this;
}
/**
* @return Collection<int, TmpConteneurReception>
*/
public function getTmpConteneurReceptions(): Collection
{
return $this->tmpConteneurReceptions;
}
public function addTmpConteneurReception(TmpConteneurReception $tmpConteneurReception): self
{
if (!$this->tmpConteneurReceptions->contains($tmpConteneurReception)) {
$this->tmpConteneurReceptions[] = $tmpConteneurReception;
$tmpConteneurReception->setTmpReception($this);
}
return $this;
}
public function removeTmpConteneurReception(TmpConteneurReception $tmpConteneurReception): self
{
if ($this->tmpConteneurReceptions->removeElement($tmpConteneurReception)) {
// set the owning side to null (unless already changed)
if ($tmpConteneurReception->getTmpReception() === $this) {
$tmpConteneurReception->setTmpReception(null);
}
}
return $this;
}
public function getTotalLOADED()
{
$total = 0;
foreach($this->getTmpConteneurReceptions() as $v){
$total = $total + $v->getQuantite();
}
return $this->totalLoaded = $total;
}
}