var/classes/DataObject/MediaArticle.php line 36

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - title [input]
  8.  * - date [datetime]
  9.  * - introtext [textarea]
  10.  * - category [select]
  11.  * - urlSlug [input]
  12.  * - externalUrl [link]
  13.  * - tileImage [image]
  14.  * - mainImage [image]
  15.  * - content [wysiwyg]
  16.  */
  17. namespace Pimcore\Model\DataObject;
  18. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  19. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  20. /**
  21. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing getList(array $config = [])
  22. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  23. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByDate($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByIntrotext($value, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByUrlSlug($value, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByTileImage($value, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByMainImage($value, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\MediaArticle\Listing|\Pimcore\Model\DataObject\MediaArticle|null getByContent($value, $limit = 0, $offset = 0, $objectTypes = null)
  30. */
  31. class MediaArticle extends Concrete
  32. {
  33. protected $o_classId "5";
  34. protected $o_className "MediaArticle";
  35. protected $title;
  36. protected $date;
  37. protected $introtext;
  38. protected $category;
  39. protected $urlSlug;
  40. protected $externalUrl;
  41. protected $tileImage;
  42. protected $mainImage;
  43. protected $content;
  44. /**
  45. * @param array $values
  46. * @return \Pimcore\Model\DataObject\MediaArticle
  47. */
  48. public static function create($values = array()) {
  49.     $object = new static();
  50.     $object->setValues($values);
  51.     return $object;
  52. }
  53. /**
  54. * Get title - Title
  55. * @return string|null
  56. */
  57. public function getTitle()
  58. {
  59.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  60.         $preValue $this->preGetValue("title");
  61.         if ($preValue !== null) {
  62.             return $preValue;
  63.         }
  64.     }
  65.     $data $this->title;
  66.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  67.         return $data->getPlain();
  68.     }
  69.     return $data;
  70. }
  71. /**
  72. * Set title - Title
  73. * @param string|null $title
  74. * @return \Pimcore\Model\DataObject\MediaArticle
  75. */
  76. public function setTitle($title)
  77. {
  78.     $this->title $title;
  79.     return $this;
  80. }
  81. /**
  82. * Get date - Date
  83. * @return \Carbon\Carbon|null
  84. */
  85. public function getDate()
  86. {
  87.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  88.         $preValue $this->preGetValue("date");
  89.         if ($preValue !== null) {
  90.             return $preValue;
  91.         }
  92.     }
  93.     $data $this->date;
  94.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  95.         return $data->getPlain();
  96.     }
  97.     return $data;
  98. }
  99. /**
  100. * Set date - Date
  101. * @param \Carbon\Carbon|null $date
  102. * @return \Pimcore\Model\DataObject\MediaArticle
  103. */
  104. public function setDate($date)
  105. {
  106.     $this->date $date;
  107.     return $this;
  108. }
  109. /**
  110. * Get introtext - Text on tile
  111. * @return string|null
  112. */
  113. public function getIntrotext()
  114. {
  115.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  116.         $preValue $this->preGetValue("introtext");
  117.         if ($preValue !== null) {
  118.             return $preValue;
  119.         }
  120.     }
  121.     $data $this->introtext;
  122.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  123.         return $data->getPlain();
  124.     }
  125.     return $data;
  126. }
  127. /**
  128. * Set introtext - Text on tile
  129. * @param string|null $introtext
  130. * @return \Pimcore\Model\DataObject\MediaArticle
  131. */
  132. public function setIntrotext($introtext)
  133. {
  134.     $this->introtext $introtext;
  135.     return $this;
  136. }
  137. /**
  138. * Get category - Category
  139. * @return string|null
  140. */
  141. public function getCategory()
  142. {
  143.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  144.         $preValue $this->preGetValue("category");
  145.         if ($preValue !== null) {
  146.             return $preValue;
  147.         }
  148.     }
  149.     $data $this->category;
  150.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  151.         return $data->getPlain();
  152.     }
  153.     return $data;
  154. }
  155. /**
  156. * Set category - Category
  157. * @param string|null $category
  158. * @return \Pimcore\Model\DataObject\MediaArticle
  159. */
  160. public function setCategory($category)
  161. {
  162.     $this->category $category;
  163.     return $this;
  164. }
  165. /**
  166. * Get urlSlug - URL Slug
  167. * @return string|null
  168. */
  169. public function getUrlSlug()
  170. {
  171.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  172.         $preValue $this->preGetValue("urlSlug");
  173.         if ($preValue !== null) {
  174.             return $preValue;
  175.         }
  176.     }
  177.     $data $this->urlSlug;
  178.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  179.         return $data->getPlain();
  180.     }
  181.     return $data;
  182. }
  183. /**
  184. * Set urlSlug - URL Slug
  185. * @param string|null $urlSlug
  186. * @return \Pimcore\Model\DataObject\MediaArticle
  187. */
  188. public function setUrlSlug($urlSlug)
  189. {
  190.     $this->urlSlug $urlSlug;
  191.     return $this;
  192. }
  193. /**
  194. * Get externalUrl - External URL
  195. * @return \Pimcore\Model\DataObject\Data\Link|null
  196. */
  197. public function getExternalUrl()
  198. {
  199.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  200.         $preValue $this->preGetValue("externalUrl");
  201.         if ($preValue !== null) {
  202.             return $preValue;
  203.         }
  204.     }
  205.     $data $this->externalUrl;
  206.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  207.         return $data->getPlain();
  208.     }
  209.     return $data;
  210. }
  211. /**
  212. * Set externalUrl - External URL
  213. * @param \Pimcore\Model\DataObject\Data\Link|null $externalUrl
  214. * @return \Pimcore\Model\DataObject\MediaArticle
  215. */
  216. public function setExternalUrl($externalUrl)
  217. {
  218.     $this->externalUrl $externalUrl;
  219.     return $this;
  220. }
  221. /**
  222. * Get tileImage - Image on tile
  223. * @return \Pimcore\Model\Asset\Image|null
  224. */
  225. public function getTileImage()
  226. {
  227.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  228.         $preValue $this->preGetValue("tileImage");
  229.         if ($preValue !== null) {
  230.             return $preValue;
  231.         }
  232.     }
  233.     $data $this->tileImage;
  234.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  235.         return $data->getPlain();
  236.     }
  237.     return $data;
  238. }
  239. /**
  240. * Set tileImage - Image on tile
  241. * @param \Pimcore\Model\Asset\Image|null $tileImage
  242. * @return \Pimcore\Model\DataObject\MediaArticle
  243. */
  244. public function setTileImage($tileImage)
  245. {
  246.     $this->tileImage $tileImage;
  247.     return $this;
  248. }
  249. /**
  250. * Get mainImage - Main image
  251. * @return \Pimcore\Model\Asset\Image|null
  252. */
  253. public function getMainImage()
  254. {
  255.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  256.         $preValue $this->preGetValue("mainImage");
  257.         if ($preValue !== null) {
  258.             return $preValue;
  259.         }
  260.     }
  261.     $data $this->mainImage;
  262.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  263.         return $data->getPlain();
  264.     }
  265.     return $data;
  266. }
  267. /**
  268. * Set mainImage - Main image
  269. * @param \Pimcore\Model\Asset\Image|null $mainImage
  270. * @return \Pimcore\Model\DataObject\MediaArticle
  271. */
  272. public function setMainImage($mainImage)
  273. {
  274.     $this->mainImage $mainImage;
  275.     return $this;
  276. }
  277. /**
  278. * Get content - Content
  279. * @return string|null
  280. */
  281. public function getContent()
  282. {
  283.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  284.         $preValue $this->preGetValue("content");
  285.         if ($preValue !== null) {
  286.             return $preValue;
  287.         }
  288.     }
  289.     $data $this->getClass()->getFieldDefinition("content")->preGetData($this);
  290.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  291.         return $data->getPlain();
  292.     }
  293.     return $data;
  294. }
  295. /**
  296. * Set content - Content
  297. * @param string|null $content
  298. * @return \Pimcore\Model\DataObject\MediaArticle
  299. */
  300. public function setContent($content)
  301. {
  302.     $this->content $content;
  303.     return $this;
  304. }
  305. }