src/Entity/StockTake.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StockTakeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassStockTakeRepository::class)]
  8. class StockTake extends BaseEntity
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $description;
  16.     #[ORM\Column(type'datetime'length255nullabletrue)]
  17.     private $date;
  18.     #[ORM\Column(type'boolean')]
  19.     private $isFinished;
  20.     #[ORM\OneToMany(mappedBy'stockTake'targetEntityStockTakeProducts::class)]
  21.     private $stockTakeProducts;
  22.     #[ORM\ManyToOne(targetEntityWarehouse::class)]
  23.     private $warehouse;
  24.     public function __construct()
  25.     {
  26.         $this->stockTakeProducts = new ArrayCollection();
  27.     }
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getDescription(): ?string
  33.     {
  34.         return $this->description;
  35.     }
  36.     public function setDescription(?string $description): self
  37.     {
  38.         $this->description $description;
  39.         return $this;
  40.     }
  41.     public function getDate()
  42.     {
  43.         return $this->date;
  44.     }
  45.     public function setDate($date)
  46.     {
  47.         $this->date $date;
  48.         return $this;
  49.     }
  50.     public function isIsFinished(): ?bool
  51.     {
  52.         return $this->isFinished;
  53.     }
  54.     public function setIsFinished(bool $isFinished): self
  55.     {
  56.         $this->isFinished $isFinished;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return Collection<int, StockTakeProducts>
  61.      */
  62.     public function getStockTakeProducts(): Collection
  63.     {
  64.         return $this->stockTakeProducts;
  65.     }
  66.     public function addStockTakeProduct(StockTakeProducts $stockTakeProduct): self
  67.     {
  68.         if (!$this->stockTakeProducts->contains($stockTakeProduct)) {
  69.             $this->stockTakeProducts[] = $stockTakeProduct;
  70.             $stockTakeProduct->setStockTake($this);
  71.         }
  72.         return $this;
  73.     }
  74.     public function removeStockTakeProduct(StockTakeProducts $stockTakeProduct): self
  75.     {
  76.         if ($this->stockTakeProducts->removeElement($stockTakeProduct)) {
  77.             // set the owning side to null (unless already changed)
  78.             if ($stockTakeProduct->getStockTake() === $this) {
  79.                 $stockTakeProduct->setStockTake(null);
  80.             }
  81.         }
  82.         return $this;
  83.     }
  84.     public function getWarehouse(): ?Warehouse
  85.     {
  86.         return $this->warehouse;
  87.     }
  88.     public function setWarehouse(?Warehouse $warehouse): self
  89.     {
  90.         $this->warehouse $warehouse;
  91.         return $this;
  92.     }
  93. }