src/Flexy/ShopBundle/Entity/Product/ProductShop.php line 18

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Product;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Flexy\ShopBundle\Entity\Product\Product as EntityProduct;
  5. use App\Flexy\ShopBundle\Entity\Vendor\Vendor ;
  6. use App\Flexy\ShopBundle\Repository\ProductShopRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Doctrine\ORM\Mapping\Table ;
  11. #[ApiResource]
  12. #[Table(name'shop_product')]
  13. #[ORM\Entity(repositoryClassProductShopRepository::class)]
  14. class ProductShop extends EntityProduct
  15. {
  16.     
  17.     #[ORM\ManyToOne(targetEntityVendor::class, inversedBy'products')]
  18.     private ?\App\Flexy\ShopBundle\Entity\Vendor\Vendor $vendor null;
  19.     public function __construct()
  20.     {
  21.         parent::__construct();
  22.     }
  23.     public function getVendor(): ?Vendor
  24.     {
  25.         return $this->vendor;
  26.     }
  27.     public function setVendor(?Vendor $vendor): self
  28.     {
  29.         $this->vendor $vendor;
  30.         return $this;
  31.     }
  32.  
  33. }