/
home
/
ubuntu
/
html
/
mixchief_app
/
src
/
Entity
/
Upload File
HOME
<?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** * Stock * * @ORM\Table(name="stock") * @ORM\Entity(repositoryClass="App\Repository\StockRepository") */ class Stock { /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var int * * @ORM\Column(name="name", type="string", unique=false) */ private $name; /** * @var float * * @ORM\Column(name="quantity", type="float") */ private $quantity = 0; /** * @var string * * @ORM\Column(name="unit", type="string", nullable=true) */ private $unit; /** * @var bool * * @ORM\Column(name="deleted", type="boolean", nullable=true) */ private $deleted; /** * @var int * * @ORM\Column(name="user_id", type="integer", nullable=true) */ private $userId; /** * @ORM\OneToMany(targetEntity=Spillage::class, mappedBy="stock", orphanRemoval=true) */ private $spillages; public function __construct() { $this->spillages = new ArrayCollection(); } /** * Set userId * * @param int $userId * * @return Groups */ public function setUserId($userId) { $this->userId = $userId; return $this; } /** * Get userId * * @return int */ public function getUserId() { return $this->userId; } /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set name * * @param String $name * * @return Stock */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set deleted * * @param float $deleted * * @return Item */ public function setDeleted($deleted) { $this->deleted = $deleted; return $this; } /** * Get deleted * * @return boolean */ public function getDeleted() { return $this->deleted; } /** * Set quantity * * @param float $quantity * * @return Stock */ public function setQuantity($quantity) { $this->quantity = $quantity; return $this; } /** * Get quantity * * @return float */ public function getQuantity() { return $this->quantity; } /** * Set unit * * @param string $unit * * @return Orders */ public function setUnit($unit) { $this->unit = $unit; return $this; } /** * Get unit * * @return string */ public function getUnit() { return $this->unit; } /** * @return Collection<int, Spillage> */ public function getSpillages(): Collection { return $this->spillages; } public function addSpillage(Spillage $spillage): self { if (!$this->spillages->contains($spillage)) { $this->spillages[] = $spillage; $spillage->setStock($this); } return $this; } public function removeSpillage(Spillage $spillage): self { if ($this->spillages->removeElement($spillage)) { // set the owning side to null (unless already changed) if ($spillage->getStock() === $this) { $spillage->setStock(null); } } return $this; } }