src/Entity/ProductCategory.php line 25

Open in your IDE?
  1. <?php
  2. // src/Acme/UserBundle/Entity/User.php
  3. namespace App\Entity;
  4. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  5. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  6. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  7. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  9. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  10. use Doctrine\ORM\Mapping as ORM;
  11. /**
  12.  * @Doctrine\ORM\Mapping\Entity
  13.  * @Doctrine\ORM\Mapping\Table(name="product_category")
  14.  */
  15. class ProductCategory implements BlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  16.     use BlameableTrait;
  17.     use TimestampableTrait;
  18.     
  19.     use SoftDeletableTrait;
  20.     
  21. /**
  22.      * @var integer
  23.      *
  24.      * @ORM\Column(name="id", type="integer", nullable=false)
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue(strategy="IDENTITY")
  27.      */
  28.     private $id;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="products")
  31.      * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
  32.      */
  33.     protected $category;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="categories")
  36.      * @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  37.      */
  38.     protected $product;
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(name="position", type="integer", nullable=true)
  43.      */
  44.     private $position;
  45.     /**
  46.      * Get id
  47.      *
  48.      * @return integer
  49.      */
  50.     public function getId()
  51.     {
  52.         return $this->id;
  53.     }
  54.     /**
  55.      * Set position
  56.      *
  57.      * @param integer $position
  58.      *
  59.      * @return ProductCategory
  60.      */
  61.     public function setPosition($position)
  62.     {
  63.         $this->position $position;
  64.         return $this;
  65.     }
  66.     /**
  67.      * Get position
  68.      *
  69.      * @return integer
  70.      */
  71.     public function getPosition()
  72.     {
  73.         return $this->position;
  74.     }
  75.     /**
  76.      * Set category
  77.      *
  78.      * @param \App\Entity\Category $category
  79.      *
  80.      * @return ProductCategory
  81.      */
  82.     public function setCategory(\App\Entity\Category $category null)
  83.     {
  84.         $this->category $category;
  85.         return $this;
  86.     }
  87.     /**
  88.      * Get category
  89.      *
  90.      * @return \App\Entity\Category
  91.      */
  92.     public function getCategory()
  93.     {
  94.         return $this->category;
  95.     }
  96.     /**
  97.      * Set product
  98.      *
  99.      * @param \App\Entity\Product $product
  100.      *
  101.      * @return ProductCategory
  102.      */
  103.     public function setProduct(\App\Entity\Product $product null)
  104.     {
  105.         $this->product $product;
  106.         return $this;
  107.     }
  108.     /**
  109.      * Get product
  110.      *
  111.      * @return \App\Entity\Product
  112.      */
  113.     public function getProduct()
  114.     {
  115.         return $this->product;
  116.     }
  117. }