modules/QSL/ProductFeeds/src/Model/GoogleShoppingCategory.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.  * GoogleShoppingCategory category model.
  10.  *
  11.  * @ORM\Entity (repositoryClass="\QSL\ProductFeeds\Model\Repo\GoogleShoppingCategory")
  12.  * @ORM\Table  (name="google_shopping_categories",
  13.  *      indexes={
  14.  *          @ORM\Index (name="name", columns={"name"})
  15.  *      }
  16.  * )
  17.  */
  18. class GoogleShoppingCategory extends \XLite\Model\AEntity
  19. {
  20.     /**
  21.      * GoogleShopping category identifier.
  22.      *
  23.      * @var integer
  24.      *
  25.      * @ORM\Id
  26.      * @ORM\Column (type="integer", unique=true, options={ "unsigned": true })
  27.      */
  28.     protected $google_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 GoogleShopping category.
  39.      *
  40.      * @var \Doctrine\Common\Collections\Collection
  41.      *
  42.      * @ORM\OneToMany (targetEntity="XLite\Model\Product", mappedBy="googleShoppingCategory")
  43.      */
  44.     protected $products;
  45.     /**
  46.      * Whether the category is deprecated, or not.
  47.      *
  48.      * @var boolean
  49.      *
  50.      * @ORM\Column (type="boolean")
  51.      */
  52.     protected $deprecated false;
  53.     /**
  54.      * Constructor.
  55.      *
  56.      * @param array $data Entity properties OPTIONAL
  57.      */
  58.     public function __construct(array $data = [])
  59.     {
  60.         $this->products = new \Doctrine\Common\Collections\ArrayCollection();
  61.         parent::__construct($data);
  62.     }
  63.     /**
  64.      * Get object unique id
  65.      *
  66.      * @return integer
  67.      */
  68.     public function getId()
  69.     {
  70.         return $this->getGoogleId();
  71.     }
  72.     /**
  73.      * Set the entity identifier.
  74.      *
  75.      * @param integer $googleId Identifier
  76.      *
  77.      * @return GoogleShoppingCategory
  78.      */
  79.     public function setGoogleId($googleId)
  80.     {
  81.         $this->google_id $googleId;
  82.         return $this;
  83.     }
  84.     /**
  85.      * Get the entity identifier.
  86.      *
  87.      * @return integer
  88.      */
  89.     public function getGoogleId()
  90.     {
  91.         return $this->google_id;
  92.     }
  93.     /**
  94.      * Set name
  95.      *
  96.      * @param string $name Name
  97.      *
  98.      * @return GoogleShoppingCategory
  99.      */
  100.     public function setName($name)
  101.     {
  102.         $this->name $name;
  103.         return $this;
  104.     }
  105.     /**
  106.      * Get name
  107.      *
  108.      * @return string
  109.      */
  110.     public function getName()
  111.     {
  112.         return $this->name;
  113.     }
  114.     /**
  115.      * Sets the "deprecated" flag.
  116.      *
  117.      * @param boolean $deprecated Flag
  118.      *
  119.      * @return GoogleShoppingCategory
  120.      */
  121.     public function setDeprecated($deprecated)
  122.     {
  123.         $this->deprecated $deprecated;
  124.         return $this;
  125.     }
  126.     /**
  127.      * Returns the "deprecated" flag.
  128.      *
  129.      * @return boolean
  130.      */
  131.     public function getDeprecated()
  132.     {
  133.         return $this->deprecated;
  134.     }
  135.     /**
  136.      * Add product
  137.      *
  138.      * @param \XLite\Model\Product $product Product
  139.      *
  140.      * @return GoogleShoppingCategory
  141.      */
  142.     public function addProducts(\XLite\Model\Product $product)
  143.     {
  144.         $this->products[] = $product;
  145.         return $this;
  146.     }
  147.     /**
  148.      * Get products
  149.      *
  150.      * @return \Doctrine\Common\Collections\Collection
  151.      */
  152.     public function getProducts()
  153.     {
  154.         return $this->products;
  155.     }
  156. }