modules/QSL/ProductFeeds/src/Model/PricegrabberCategory.php line 22

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\ProductFeeds\Model;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * PricegrabberCategory category model.
  10.  *
  11.  * @ORM\Entity (repositoryClass="\QSL\ProductFeeds\Model\Repo\PricegrabberCategory")
  12.  * @ORM\Table  (name="pricegrabber_categories",
  13.  *      indexes={
  14.  *          @ORM\Index (name="name", columns={"name"})
  15.  *      }
  16.  * )
  17.  */
  18. class PricegrabberCategory extends \XLite\Model\AEntity
  19. {
  20.     /**
  21.      * Pricegrabber category identifier.
  22.      *
  23.      * @var integer
  24.      *
  25.      * @ORM\Id
  26.      * @ORM\Column (type="integer", unique=true, options={ "unsigned": true })
  27.      */
  28.     protected $pricegrabber_id;
  29.     /**
  30.      * Category name.
  31.      *
  32.      * @var string
  33.      *
  34.      * @ORM\Column (type="string", length=255)
  35.      */
  36.     protected $name;
  37.     /**
  38.      * Products added to the Pricegrabber category.
  39.      *
  40.      * @var \Doctrine\Common\Collections\Collection
  41.      *
  42.      * @ORM\OneToMany (targetEntity="XLite\Model\Product", mappedBy="pricegrabberCategory")
  43.      */
  44.     protected $products;
  45.     /**
  46.      * Constructor.
  47.      *
  48.      * @param array $data Entity properties OPTIONAL
  49.      */
  50.     public function __construct(array $data = [])
  51.     {
  52.         $this->products = new \Doctrine\Common\Collections\ArrayCollection();
  53.         parent::__construct($data);
  54.     }
  55.     /**
  56.      * Get object unique id
  57.      *
  58.      * @return integer
  59.      */
  60.     public function getId()
  61.     {
  62.         return $this->getPricegrabberId();
  63.     }
  64.     /**
  65.      * Set the entity identifier.
  66.      *
  67.      * @param integer $pricegrabberId Identifier
  68.      *
  69.      * @return PricegrabberCategory
  70.      */
  71.     public function setPricegrabberId($pricegrabberId)
  72.     {
  73.         $this->pricegrabber_id $pricegrabberId;
  74.         return $this;
  75.     }
  76.     /**
  77.      * Return thes entity identifier.
  78.      *
  79.      * @return integer
  80.      */
  81.     public function getPricegrabberId()
  82.     {
  83.         return $this->pricegrabber_id;
  84.     }
  85.     /**
  86.      * Set name
  87.      *
  88.      * @param string $name Name
  89.      *
  90.      * @return PricegrabberCategory
  91.      */
  92.     public function setName($name)
  93.     {
  94.         $this->name $name;
  95.         return $this;
  96.     }
  97.     /**
  98.      * Get name
  99.      *
  100.      * @return string
  101.      */
  102.     public function getName()
  103.     {
  104.         return $this->name;
  105.     }
  106.     /**
  107.      * Add product
  108.      *
  109.      * @param \XLite\Model\Product $product Product
  110.      *
  111.      * @return PricegrabberCategory
  112.      */
  113.     public function addProducts(\XLite\Model\Product $product)
  114.     {
  115.         $this->products[] = $product;
  116.         return $this;
  117.     }
  118.     /**
  119.      * Get products
  120.      *
  121.      * @return \Doctrine\Common\Collections\Collection
  122.      */
  123.     public function getProducts()
  124.     {
  125.         return $this->products;
  126.     }
  127. }