<?php
// vim: set ts=4 sw=4 sts=4 et:
/**
* Product Videos Module
*
* @category X-Cart_5_5_Module
* @package ProductVideos
* @author CFL Systems, Inc. <support@cflsystems.com>
* @copyright 2023 CFL Systems, Inc. All rights reserved.
* @license License Agreement - https://www.cflsystems.com/software-license-agreement.html
* @link https://www.cflsystems.com/product-videos-for-x-cart-5.html
*/
namespace CSI\ProductVideos\Model;
use XLite\Model\Product;
use Doctrine\ORM\Mapping as ORM;
/**
* The "video" model class
*
* @ORM\Entity
* @ORM\Table (name="product_videos")
*/
class Video extends \XLite\Model\Base\I18n
{
/**
* Video unique ID
*
* @var integer
*
* @ORM\Id
* @ORM\GeneratedValue (strategy="AUTO")
* @ORM\Column (type="integer")
*/
protected $id;
/**
* Video position
*
* @var integer
*
* @ORM\Column (type="integer")
*/
protected $position = 0;
/**
* Is video available or not
*
* @var boolean
*
* @ORM\Column (type="boolean")
*/
protected $enabled = true;
/**
* Is video self-hosted
*
* @var boolean
*
* @ORM\Column (type="boolean")
*/
protected $self_hosted = false;
/**
* Video product
*
* @var \XLite\Model\Product
*
* @ORM\ManyToOne (targetEntity="XLite\Model\Product", inversedBy="videos")
* @ORM\JoinColumn (name="product_id", referencedColumnName="product_id", onDelete="CASCADE")
*/
protected $product;
/**
* Video url
*
* @ORM\Column (type="string", length=255)
*/
protected $url = '';
/**
* Video thumb url
*
* @ORM\Column (type="string", length=255)
*/
protected $thumb_url = '';
/**
* Translations (relation). AUTOGENERATED
*
* @var \Doctrine\Common\Collections\ArrayCollection
*
* @ORM\OneToMany (targetEntity="CSI\ProductVideos\Model\VideoTranslation", mappedBy="owner", cascade={"all"})
*/
protected $translations;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set position
*
* @param integer $position
*
* @return self
*/
public function setPosition($position)
{
$this->position = $position;
return $this;
}
/**
* Get position
*
* @return integer
*/
public function getPosition()
{
return $this->position;
}
/**
* Set enabled
*
* @param boolean $enabled
*
* @return self
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
return $this;
}
/**
* Get enabled
*
* @return boolean
*/
public function getEnabled()
{
return $this->enabled;
}
/**
* Set self_hosted
*
* @param boolean $selfHosted
*
* @return self
*/
public function setSelfHosted($selfHosted)
{
$this->self_hosted = $selfHosted;
return $this;
}
/**
* Get self_hosted
*
* @return boolean
*/
public function getSelfHosted()
{
return $this->self_hosted;
}
/**
* Set url
*
* @param string $url
*
* @return self
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* Get url
*
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* Set thumb_url
*
* @param string $thumbUrl
*
* @return self
*/
public function setThumbUrl($thumbUrl)
{
$this->thumb_url = $thumbUrl;
return $this;
}
/**
* Get thumb_url
*
* @return string
*/
public function getThumbUrl()
{
return $this->thumb_url;
}
/**
* Set product
*
* @param Product $product
*
* @return self
*/
public function setProduct(Product $product = null)
{
$this->product = $product;
return $this;
}
/**
* Get product
*
* @return Product
*/
public function getProduct()
{
return $this->product;
}
/**
* Translation getter.
*
* @return string
*/
public function getTitle()
{
return $this->getTranslationField(__FUNCTION__);
}
/**
* Translation setter.
*
* @param string $value value to set
*
* @return void
*/
public function setTitle($value)
{
return $this->setTranslationField(__FUNCTION__, $value);
}
/**
* Translation getter.
*
* @return string
*/
public function getDescription()
{
return $this->getTranslationField(__FUNCTION__);
}
/**
* Translation setter.
*
* @param string $value value to set
*
* @return void
*/
public function setDescription($value)
{
return $this->setTranslationField(__FUNCTION__, $value);
}
}