src/Entity/ProductCategory.php line 20

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 BlameableInterfaceTimestampableInterface  {
  16.     use BlameableTrait;
  17.     use TimestampableTrait;
  18.     /**
  19.      * @var integer
  20.      *
  21.      * @ORM\Column(name="id", type="integer", nullable=false)
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="IDENTITY")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="products")
  28.      * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
  29.      */
  30.     protected $category;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="categories")
  33.      * @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  34.      */
  35.     protected $product;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="position", type="integer", nullable=true)
  40.      */
  41.     private $position;
  42.     /**
  43.      * Get id
  44.      *
  45.      * @return integer
  46.      */
  47.     public function getId()
  48.     {
  49.         return $this->id;
  50.     }
  51.     /**
  52.      * Set position
  53.      *
  54.      * @param integer $position
  55.      *
  56.      * @return ProductCategory
  57.      */
  58.     public function setPosition($position)
  59.     {
  60.         $this->position $position;
  61.         return $this;
  62.     }
  63.     /**
  64.      * Get position
  65.      *
  66.      * @return integer
  67.      */
  68.     public function getPosition()
  69.     {
  70.         return $this->position;
  71.     }
  72.     /**
  73.      * Set category
  74.      *
  75.      * @param \App\Entity\Category $category
  76.      *
  77.      * @return ProductCategory
  78.      */
  79.     public function setCategory(\App\Entity\Category $category null)
  80.     {
  81.         $this->category $category;
  82.         return $this;
  83.     }
  84.     /**
  85.      * Get category
  86.      *
  87.      * @return \App\Entity\Category
  88.      */
  89.     public function getCategory()
  90.     {
  91.         return $this->category;
  92.     }
  93.     /**
  94.      * Set product
  95.      *
  96.      * @param \App\Entity\Product $product
  97.      *
  98.      * @return ProductCategory
  99.      */
  100.     public function setProduct(\App\Entity\Product $product null)
  101.     {
  102.         $this->product $product;
  103.         return $this;
  104.     }
  105.     /**
  106.      * Get product
  107.      *
  108.      * @return \App\Entity\Product
  109.      */
  110.     public function getProduct()
  111.     {
  112.         return $this->product;
  113.     }
  114. }