modules/CSI/ProductVideos/src/Model/Video.php line 26

Open in your IDE?
  1. <?php
  2. // vim: set ts=4 sw=4 sts=4 et:
  3. /**
  4.  * Product Videos Module
  5.  *
  6.  * @category  X-Cart_5_5_Module
  7.  * @package   ProductVideos
  8.  * @author    CFL Systems, Inc. <support@cflsystems.com>
  9.  * @copyright 2023 CFL Systems, Inc. All rights reserved.
  10.  * @license   License Agreement - https://www.cflsystems.com/software-license-agreement.html
  11.  * @link      https://www.cflsystems.com/product-videos-for-x-cart-5.html
  12.  */
  13. namespace CSI\ProductVideos\Model;
  14. use XLite\Model\Product;
  15. use Doctrine\ORM\Mapping as ORM;
  16. /**
  17.  * The "video" model class
  18.  *
  19.  * @ORM\Entity
  20.  * @ORM\Table  (name="product_videos")
  21.  */
  22. class Video extends \XLite\Model\Base\I18n
  23. {
  24.     /**
  25.      * Video unique ID
  26.      *
  27.      * @var integer
  28.      *
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue (strategy="AUTO")
  31.      * @ORM\Column         (type="integer")
  32.      */
  33.     protected $id;
  34.     /**
  35.      * Video position
  36.      *
  37.      * @var integer
  38.      *
  39.      * @ORM\Column (type="integer")
  40.      */
  41.     protected $position 0;
  42.     /**
  43.      * Is video available or not
  44.      *
  45.      * @var boolean
  46.      *
  47.      * @ORM\Column (type="boolean")
  48.      */
  49.     protected $enabled true;
  50.     /**
  51.      * Is video self-hosted
  52.      *
  53.      * @var boolean
  54.      *
  55.      * @ORM\Column (type="boolean")
  56.      */
  57.     protected $self_hosted false;
  58.     /**
  59.      * Video product
  60.      *
  61.      * @var \XLite\Model\Product
  62.      *
  63.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Product", inversedBy="videos")
  64.      * @ORM\JoinColumn (name="product_id", referencedColumnName="product_id", onDelete="CASCADE")
  65.      */
  66.     protected $product;
  67.     /**
  68.      * Video url
  69.      *
  70.      * @ORM\Column (type="string", length=255)
  71.      */
  72.     protected $url '';
  73.     /**
  74.      * Video thumb url
  75.      *
  76.      * @ORM\Column (type="string", length=255)
  77.      */
  78.     protected $thumb_url '';
  79.     /**
  80.      * Translations (relation). AUTOGENERATED
  81.      *
  82.      * @var \Doctrine\Common\Collections\ArrayCollection
  83.      *
  84.      * @ORM\OneToMany (targetEntity="CSI\ProductVideos\Model\VideoTranslation", mappedBy="owner", cascade={"all"})
  85.      */
  86.     protected $translations;
  87.     /**
  88.      * Get id
  89.      *
  90.      * @return integer
  91.      */
  92.     public function getId()
  93.     {
  94.         return $this->id;
  95.     }
  96.     /**
  97.      * Set position
  98.      *
  99.      * @param integer $position
  100.      *
  101.      * @return self
  102.      */
  103.     public function setPosition($position)
  104.     {
  105.         $this->position $position;
  106.         return $this;
  107.     }
  108.     /**
  109.      * Get position
  110.      *
  111.      * @return integer
  112.      */
  113.     public function getPosition()
  114.     {
  115.         return $this->position;
  116.     }
  117.     /**
  118.      * Set enabled
  119.      *
  120.      * @param boolean $enabled
  121.      *
  122.      * @return self
  123.      */
  124.     public function setEnabled($enabled)
  125.     {
  126.         $this->enabled $enabled;
  127.         return $this;
  128.     }
  129.     /**
  130.      * Get enabled
  131.      *
  132.      * @return boolean
  133.      */
  134.     public function getEnabled()
  135.     {
  136.         return $this->enabled;
  137.     }
  138.     /**
  139.      * Set self_hosted
  140.      *
  141.      * @param boolean $selfHosted
  142.      *
  143.      * @return self
  144.      */
  145.     public function setSelfHosted($selfHosted)
  146.     {
  147.         $this->self_hosted $selfHosted;
  148.         return $this;
  149.     }
  150.     /**
  151.      * Get self_hosted
  152.      *
  153.      * @return boolean
  154.      */
  155.     public function getSelfHosted()
  156.     {
  157.         return $this->self_hosted;
  158.     }
  159.     /**
  160.      * Set url
  161.      *
  162.      * @param string $url
  163.      *
  164.      * @return self
  165.      */
  166.     public function setUrl($url)
  167.     {
  168.         $this->url $url;
  169.         return $this;
  170.     }
  171.     /**
  172.      * Get url
  173.      *
  174.      * @return string
  175.      */
  176.     public function getUrl()
  177.     {
  178.         return $this->url;
  179.     }
  180.     /**
  181.      * Set thumb_url
  182.      *
  183.      * @param string $thumbUrl
  184.      *
  185.      * @return self
  186.      */
  187.     public function setThumbUrl($thumbUrl)
  188.     {
  189.         $this->thumb_url $thumbUrl;
  190.         return $this;
  191.     }
  192.     /**
  193.      * Get thumb_url
  194.      *
  195.      * @return string
  196.      */
  197.     public function getThumbUrl()
  198.     {
  199.         return $this->thumb_url;
  200.     }
  201.     /**
  202.      * Set product
  203.      *
  204.      * @param Product $product
  205.      *
  206.      * @return self
  207.      */
  208.     public function setProduct(Product $product null)
  209.     {
  210.         $this->product $product;
  211.         return $this;
  212.     }
  213.     /**
  214.      * Get product
  215.      *
  216.      * @return Product
  217.      */
  218.     public function getProduct()
  219.     {
  220.         return $this->product;
  221.     }
  222.     /**
  223.      * Translation getter.
  224.      *
  225.      * @return string
  226.      */
  227.     public function getTitle()
  228.     {
  229.         return $this->getTranslationField(__FUNCTION__);
  230.     }
  231.     /**
  232.      * Translation setter.
  233.      *
  234.      * @param string $value value to set
  235.      *
  236.      * @return void
  237.      */
  238.     public function setTitle($value)
  239.     {
  240.         return $this->setTranslationField(__FUNCTION__$value);
  241.     }
  242.     /**
  243.      * Translation getter.
  244.      *
  245.      * @return string
  246.      */
  247.     public function getDescription()
  248.     {
  249.         return $this->getTranslationField(__FUNCTION__);
  250.     }
  251.     /**
  252.      * Translation setter.
  253.      *
  254.      * @param string $value value to set
  255.      *
  256.      * @return void
  257.      */
  258.     public function setDescription($value)
  259.     {
  260.         return $this->setTranslationField(__FUNCTION__$value);
  261.     }
  262. }