src/Entity/Inventory.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InventoryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use Doctrine\ORM\Mapping\UniqueConstraint;
  9. /**
  10.  * @ORM\Entity(repositoryClass=InventoryRepository::class)
  11.  * @ORM\Table(name="inventory")
  12.  * ORM\Table(name="inventory", uniqueConstraints={
  13.  *            UniqueConstraint(name="unique_inventory_material", columns={"material_id", "stock_id"})
  14.  *       })
  15.  */
  16. class Inventory
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      * @Groups({
  23.      *        "inventory.base"
  24.      *    })
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $name;
  31.     /**
  32.      * @ORM\Column(type="string", length=64, nullable=true)
  33.      */
  34.     private $intern_item_no;
  35.     /**
  36.      * @ORM\Column(type="string", length=64)
  37.      */
  38.     private $extern_item_no;
  39.     /**
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      */
  42.     private $ean;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=Manufacturer::class, inversedBy="inventories")
  45.      * @ORM\JoinColumn(nullable=false)
  46.      */
  47.     private $manufacturer;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      */
  51.     private $description;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity=Unit::class, inversedBy="inventories")
  54.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  55.      */
  56.     private $unit;
  57.     /**
  58.      * @ORM\Column(type="float", nullable=true)
  59.      */
  60.     private $purchase_price;
  61.     /**
  62.      * @ORM\Column(type="float", nullable=true)
  63.      */
  64.     private $sales_price;
  65.     /**
  66.      * @ORM\ManyToOne(targetEntity=InventoryCategories::class, inversedBy="inventories")
  67.      */
  68.     private $category;
  69.     /**
  70.      * @ORM\ManyToMany(targetEntity=InventoryGroups::class, inversedBy="inventories")
  71.      */
  72.     private $item_group;
  73.     public function __construct()
  74.     {
  75.         $this->item_group = new ArrayCollection();
  76.     }
  77.     public function getInternItemNo(): ?string
  78.     {
  79.         return $this->intern_item_no;
  80.     }
  81.     public function setInternItemNo(?string $intern_item_no): self
  82.     {
  83.         $this->intern_item_no $intern_item_no;
  84.         return $this;
  85.     }
  86.     public function getExternItemNo(): ?string
  87.     {
  88.         return $this->extern_item_no;
  89.     }
  90.     public function setExternItemNo(string $extern_item_no): self
  91.     {
  92.         $this->extern_item_no $extern_item_no;
  93.         return $this;
  94.     }
  95.     public function getEan(): ?string
  96.     {
  97.         return $this->ean;
  98.     }
  99.     public function setEan(?string $ean): self
  100.     {
  101.         $this->ean $ean;
  102.         return $this;
  103.     }
  104.     public function getManufacturer(): ?Manufacturer
  105.     {
  106.         return $this->manufacturer;
  107.     }
  108.     public function setManufacturer(?Manufacturer $manufacturer): self
  109.     {
  110.         $this->manufacturer $manufacturer;
  111.         return $this;
  112.     }
  113.     public function getDescription(): ?string
  114.     {
  115.         return $this->description;
  116.     }
  117.     public function setDescription(?string $description): self
  118.     {
  119.         $this->description $description;
  120.         return $this;
  121.     }
  122.     public function getUnit(): ?Unit
  123.     {
  124.         return $this->unit;
  125.     }
  126.     public function setUnit(?Unit $unit): self
  127.     {
  128.         $this->unit $unit;
  129.         return $this;
  130.     }
  131.     public function getPurchasePrice(): ?float
  132.     {
  133.         return $this->purchase_price;
  134.     }
  135.     public function setPurchasePrice(?float $purchase_price): self
  136.     {
  137.         $this->purchase_price $purchase_price;
  138.         return $this;
  139.     }
  140.     public function getSalesPrice(): ?float
  141.     {
  142.         return $this->sales_price;
  143.     }
  144.     public function setSalesPrice(?float $sales_price): self
  145.     {
  146.         $this->sales_price $sales_price;
  147.         return $this;
  148.     }
  149.     public function getCategory(): ?InventoryCategories
  150.     {
  151.         return $this->category;
  152.     }
  153.     public function setCategory(?InventoryCategories $category): self
  154.     {
  155.         $this->category $category;
  156.         return $this;
  157.     }
  158.     public function getQuantity(): ?int
  159.     {
  160.         return $this->quantity;
  161.     }
  162.     public function setQuantity(?int $quantity): self
  163.     {
  164.         $this->quantity $quantity;
  165.         return $this;
  166.     }
  167.     /**
  168.      * @return Collection<int, InventoryGroups>
  169.      */
  170.     public function getItemGroup(): Collection
  171.     {
  172.         return $this->item_group;
  173.     }
  174.     public function addItemGroup(InventoryGroups $itemGroup): self
  175.     {
  176.         if (!$this->item_group->contains($itemGroup)) {
  177.             $this->item_group[] = $itemGroup;
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeItemGroup(InventoryGroups $itemGroup): self
  182.     {
  183.         $this->item_group->removeElement($itemGroup);
  184.         return $this;
  185.     }
  186.     public function getName(): ?string
  187.     {
  188.         return $this->name;
  189.     }
  190.     public function setName(string $name): self
  191.     {
  192.         $this->name $name;
  193.         return $this;
  194.     }
  195. }