classes/XLite/Model/CategoryProducts.php line 19

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
  4.  * See https://www.x-cart.com/license-agreement.html for license details.
  5.  */
  6. namespace XLite\Model;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * Category
  10.  *
  11.  * @ORM\Entity
  12.  * @ORM\Table (name="category_products",
  13.  *      uniqueConstraints={
  14.  *          @ORM\UniqueConstraint (name="pair", columns={"category_id","product_id"})
  15.  *      },
  16.  *      indexes={
  17.  *          @ORM\Index (name="orderby", columns={"orderby"}),
  18.  *          @ORM\Index (name="orderbyInProduct", columns={"orderbyInProduct"})
  19.  *      }
  20.  * )
  21.  */
  22. class CategoryProducts extends \XLite\Model\AEntity
  23. {
  24.     /**
  25.      * Primary key
  26.      *
  27.      * @var integer
  28.      *
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue (strategy="AUTO")
  31.      * @ORM\Column         (type="integer", options={ "unsigned": true })
  32.      */
  33.     protected $id;
  34.     /**
  35.      * Product position in the category
  36.      *
  37.      * @var integer
  38.      *
  39.      * @ORM\Column (type="integer", length=11, nullable=false)
  40.      */
  41.     protected $orderby 0;
  42.     /**
  43.      * Category position in the product
  44.      *
  45.      * @var integer
  46.      *
  47.      * @ORM\Column (type="integer", length=11, nullable=false)
  48.      */
  49.     protected $orderbyInProduct 0;
  50.     /**
  51.      * Relation to a category entity
  52.      *
  53.      * @var \Doctrine\Common\Collections\ArrayCollection
  54.      *
  55.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Category", inversedBy="categoryProducts")
  56.      * @ORM\JoinColumn (name="category_id", referencedColumnName="category_id", onDelete="CASCADE")
  57.      */
  58.     protected $category;
  59.     /**
  60.      * Relation to a product entity
  61.      *
  62.      * @var \Doctrine\Common\Collections\ArrayCollection
  63.      *
  64.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Product", inversedBy="categoryProducts")
  65.      * @ORM\JoinColumn (name="product_id", referencedColumnName="product_id", onDelete="CASCADE")
  66.      */
  67.     protected $product;
  68.     /**
  69.      * Get id
  70.      *
  71.      * @return integer
  72.      */
  73.     public function getId()
  74.     {
  75.         return $this->id;
  76.     }
  77.     /**
  78.      * Set orderby
  79.      *
  80.      * @param integer $orderby
  81.      * @return CategoryProducts
  82.      */
  83.     public function setOrderby($orderby)
  84.     {
  85.         $this->orderby $orderby;
  86.         return $this;
  87.     }
  88.     /**
  89.      * Get orderby
  90.      *
  91.      * @return integer
  92.      */
  93.     public function getOrderby()
  94.     {
  95.         return $this->orderby;
  96.     }
  97.     /**
  98.      * Set category
  99.      *
  100.      * @param \XLite\Model\Category $category
  101.      * @return CategoryProducts
  102.      */
  103.     public function setCategory(\XLite\Model\Category $category null)
  104.     {
  105.         $this->category $category;
  106.         return $this;
  107.     }
  108.     /**
  109.      * Get category
  110.      *
  111.      * @return \XLite\Model\Category
  112.      */
  113.     public function getCategory()
  114.     {
  115.         return $this->category;
  116.     }
  117.     /**
  118.      * Set product
  119.      *
  120.      * @param \XLite\Model\Product $product
  121.      * @return CategoryProducts
  122.      */
  123.     public function setProduct(\XLite\Model\Product $product null)
  124.     {
  125.         $this->product $product;
  126.         return $this;
  127.     }
  128.     /**
  129.      * Get product
  130.      *
  131.      * @return \XLite\Model\Product
  132.      */
  133.     public function getProduct()
  134.     {
  135.         return $this->product;
  136.     }
  137.     /**
  138.      * @return int
  139.      */
  140.     public function getOrderbyInProduct()
  141.     {
  142.         return $this->orderbyInProduct;
  143.     }
  144.     /**
  145.      * @param int $orderbyInProduct
  146.      */
  147.     public function setOrderbyInProduct($orderbyInProduct)
  148.     {
  149.         $this->orderbyInProduct $orderbyInProduct;
  150.     }
  151. }