modules/QSL/Make/src/Model/Level2Product.php line 21

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 QSL\Make\Model;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * Level2 to product relation
  10.  *
  11.  * @ORM\Entity
  12.  * @ORM\Table (name="level2_product",
  13.  *      uniqueConstraints={
  14.  *          @ORM\UniqueConstraint (name="pair", columns={"productId","level2Id"})
  15.  *      },
  16.  *      indexes={
  17.  *          @ORM\Index (name="position", columns={"position"}),
  18.  *          @ORM\Index (name="level2Id", columns={"level2Id"}),
  19.  *          @ORM\Index (name="productId", columns={"productId"}),
  20.  *          @ORM\Index (name="pair", columns={"productId","level2Id"})
  21.  *      }
  22.  * )
  23.  */
  24. class Level2Product extends ALevelProduct
  25. {
  26.     /**
  27.      * Relation to a product entity
  28.      *
  29.      * @var \XLite\Model\Product
  30.      *
  31.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Product", inversedBy="level2Product")
  32.      * @ORM\JoinColumn (name="productId", referencedColumnName="product_id", onDelete="CASCADE")
  33.      */
  34.     protected $product;
  35.     /**
  36.      * Relation to a model entity
  37.      *
  38.      * @var \QSL\Make\Model\Level2
  39.      *
  40.      * @ORM\ManyToOne  (targetEntity="QSL\Make\Model\Level2", inversedBy="level2Product")
  41.      * @ORM\JoinColumn (name="level2Id", referencedColumnName="id", onDelete="CASCADE")
  42.      */
  43.     protected $level;
  44.     /**
  45.      * Level getter
  46.      *
  47.      * @return mixed
  48.      */
  49.     public function getLevel()
  50.     {
  51.         return $this->level;
  52.     }
  53.     /**
  54.      * Level setter
  55.      *
  56.      * @param mixed $value
  57.      *
  58.      * @return \QSL\Make\Model\Level2Product
  59.      */
  60.     public function setLevel($value)
  61.     {
  62.         $this->level $value;
  63.         return $this;
  64.     }
  65. }