modules/CDev/ProductAdvisor/src/Model/ProductStats.php line 18

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 CDev\ProductAdvisor\Model;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * Product statistics model (for 'Customers who viewed this product bought' widget)
  10.  *
  11.  * @ORM\Entity
  12.  * @ORM\Table  (name="product_stats")
  13.  */
  14. class ProductStats extends \XLite\Model\AEntity
  15. {
  16.     /**
  17.      * Unique ID
  18.      *
  19.      * @var   integer
  20.      *
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue (strategy="AUTO")
  23.      * @ORM\Column         (type="integer", options={ "unsigned": true })
  24.      */
  25.     protected $stat_id;
  26.     /**
  27.      * Viewed product
  28.      *
  29.      * @var   \XLite\Model\Product
  30.      *
  31.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Product", inversedBy="views_stats")
  32.      * @ORM\JoinColumn (name="viewed_product_id", referencedColumnName="product_id", onDelete="CASCADE")
  33.      */
  34.     protected $viewed_product;
  35.     /**
  36.      * Bought product
  37.      *
  38.      * @var   \XLite\Model\Product
  39.      *
  40.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Product", inversedBy="purchase_stats")
  41.      * @ORM\JoinColumn (name="bought_product_id", referencedColumnName="product_id", onDelete="CASCADE")
  42.      */
  43.     protected $bought_product;
  44.     /**
  45.      * Count of bought products
  46.      *
  47.      * @var   integer
  48.      *
  49.      * @ORM\Column (type="integer", options={ "unsigned": true })
  50.      */
  51.     protected $count 1;
  52.     /**
  53.      * Get stat_id
  54.      *
  55.      * @return integer
  56.      */
  57.     public function getStatId()
  58.     {
  59.         return $this->stat_id;
  60.     }
  61.     /**
  62.      * Set count
  63.      *
  64.      * @param integer $count
  65.      * @return ProductStats
  66.      */
  67.     public function setCount($count)
  68.     {
  69.         $this->count $count;
  70.         return $this;
  71.     }
  72.     /**
  73.      * Get count
  74.      *
  75.      * @return integer
  76.      */
  77.     public function getCount()
  78.     {
  79.         return $this->count;
  80.     }
  81.     /**
  82.      * Set viewed_product
  83.      *
  84.      * @param \XLite\Model\Product $viewedProduct
  85.      * @return ProductStats
  86.      */
  87.     public function setViewedProduct(\XLite\Model\Product $viewedProduct null)
  88.     {
  89.         $this->viewed_product $viewedProduct;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Get viewed_product
  94.      *
  95.      * @return \XLite\Model\Product
  96.      */
  97.     public function getViewedProduct()
  98.     {
  99.         return $this->viewed_product;
  100.     }
  101.     /**
  102.      * Set bought_product
  103.      *
  104.      * @param \XLite\Model\Product $boughtProduct
  105.      * @return ProductStats
  106.      */
  107.     public function setBoughtProduct(\XLite\Model\Product $boughtProduct null)
  108.     {
  109.         $this->bought_product $boughtProduct;
  110.         return $this;
  111.     }
  112.     /**
  113.      * Get bought_product
  114.      *
  115.      * @return \XLite\Model\Product
  116.      */
  117.     public function getBoughtProduct()
  118.     {
  119.         return $this->bought_product;
  120.     }
  121. }