<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - title [input]
* - date [datetime]
* - introtext [textarea]
* - category [select]
* - urlSlug [input]
* - externalUrl [link]
* - tileImage [image]
* - mainImage [image]
* - content [wysiwyg]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByDate($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByIntrotext($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByUrlSlug($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByTileImage($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByMainImage($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByContent($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class MediaArticle extends Concrete
{
protected $o_classId = "5";
protected $o_className = "MediaArticle";
protected $title;
protected $date;
protected $introtext;
protected $category;
protected $urlSlug;
protected $externalUrl;
protected $tileImage;
protected $mainImage;
protected $content;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get title - Title
* @return string|null
*/
public function getTitle()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("title");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->title;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set title - Title
* @param string|null $title
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get date - Date
* @return \Carbon\Carbon|null
*/
public function getDate()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("date");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->date;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set date - Date
* @param \Carbon\Carbon|null $date
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* Get introtext - Text on tile
* @return string|null
*/
public function getIntrotext()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("introtext");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->introtext;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set introtext - Text on tile
* @param string|null $introtext
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setIntrotext($introtext)
{
$this->introtext = $introtext;
return $this;
}
/**
* Get category - Category
* @return string|null
*/
public function getCategory()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("category");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->category;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set category - Category
* @param string|null $category
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setCategory($category)
{
$this->category = $category;
return $this;
}
/**
* Get urlSlug - URL Slug
* @return string|null
*/
public function getUrlSlug()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("urlSlug");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->urlSlug;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set urlSlug - URL Slug
* @param string|null $urlSlug
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setUrlSlug($urlSlug)
{
$this->urlSlug = $urlSlug;
return $this;
}
/**
* Get externalUrl - External URL
* @return \Pimcore\Model\DataObject\Data\Link|null
*/
public function getExternalUrl()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("externalUrl");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->externalUrl;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set externalUrl - External URL
* @param \Pimcore\Model\DataObject\Data\Link|null $externalUrl
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setExternalUrl($externalUrl)
{
$this->externalUrl = $externalUrl;
return $this;
}
/**
* Get tileImage - Image on tile
* @return \Pimcore\Model\Asset\Image|null
*/
public function getTileImage()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("tileImage");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->tileImage;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set tileImage - Image on tile
* @param \Pimcore\Model\Asset\Image|null $tileImage
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setTileImage($tileImage)
{
$this->tileImage = $tileImage;
return $this;
}
/**
* Get mainImage - Main image
* @return \Pimcore\Model\Asset\Image|null
*/
public function getMainImage()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("mainImage");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->mainImage;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set mainImage - Main image
* @param \Pimcore\Model\Asset\Image|null $mainImage
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setMainImage($mainImage)
{
$this->mainImage = $mainImage;
return $this;
}
/**
* Get content - Content
* @return string|null
*/
public function getContent()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("content");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("content")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set content - Content
* @param string|null $content
* @return \Pimcore\Model\DataObject\MediaArticle
*/
public function setContent($content)
{
$this->content = $content;
return $this;
}
}