src/Entity/ProductIn.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\ProductInRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Timestampable\Traits\TimestampableEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ProductInRepository::class)
  9.  * @ApiResource(
  10.  *   normalizationContext={"groups"={"product_in:read"}},
  11.  * )
  12.  */
  13. class ProductIn
  14. {
  15.     use TimestampableEntity;
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="productIns")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $product;
  27.     /**
  28.      * @ORM\Column(type="integer")
  29.      */
  30.     private $qty;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=IncomingOrder::class, inversedBy="productIns", cascade={"persist"})
  33.      * @ORM\JoinColumn(nullable=true)
  34.      */
  35.     private ?IncomingOrder $incomingOrder;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getProduct(): ?Product
  41.     {
  42.         return $this->product;
  43.     }
  44.     public function setProduct(?Product $product): self
  45.     {
  46.         $this->product $product;
  47.         return $this;
  48.     }
  49.     public function getQty(): ?int
  50.     {
  51.         return $this->qty;
  52.     }
  53.     public function setQty(int $qty): self
  54.     {
  55.         $this->qty $qty;
  56.         return $this;
  57.     }
  58.     public function getIncomingOrder(): ?IncomingOrder
  59.     {
  60.         return $this->incomingOrder;
  61.     }
  62.     public function setIncomingOrder(?IncomingOrder $incomingOrder): self
  63.     {
  64.         $this->incomingOrder $incomingOrder;
  65.         return $this;
  66.     }
  67. }