var/classes/DataObject/Teaser.php line 40

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - headerTag [select]
  8.  * - localizedfields [localizedfields]
  9.  * -- Subtitle [input]
  10.  * -- Title [wysiwyg]
  11.  * -- Text [wysiwyg]
  12.  * -- Link [link]
  13.  * -- badge_price [input]
  14.  * -- badge_text [input]
  15.  * - linkAsButton [checkbox]
  16.  * - Image [image]
  17.  * - Video [video]
  18.  */
  19. namespace Pimcore\Model\DataObject;
  20. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  21. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  22. /**
  23. * @method static \Pimcore\Model\DataObject\Teaser\Listing getList(array $config = [])
  24. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByHeaderTag($value, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getBySubtitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByText($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByLink($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByBadge_price($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByBadge_text($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  32. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByLinkAsButton($value, $limit = 0, $offset = 0, $objectTypes = null)
  33. * @method static \Pimcore\Model\DataObject\Teaser\Listing|\Pimcore\Model\DataObject\Teaser|null getByImage($value, $limit = 0, $offset = 0, $objectTypes = null)
  34. */
  35. class Teaser extends Concrete
  36. {
  37. protected $o_classId "CNTEASER";
  38. protected $o_className "Teaser";
  39. protected $headerTag;
  40. protected $localizedfields;
  41. protected $linkAsButton;
  42. protected $Image;
  43. protected $Video;
  44. /**
  45. * @param array $values
  46. * @return \Pimcore\Model\DataObject\Teaser
  47. */
  48. public static function create($values = array()) {
  49.     $object = new static();
  50.     $object->setValues($values);
  51.     return $object;
  52. }
  53. /**
  54. * Get headerTag - Header Tag
  55. * @return string|null
  56. */
  57. public function getHeaderTag(): ?string
  58. {
  59.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  60.         $preValue $this->preGetValue("headerTag");
  61.         if ($preValue !== null) {
  62.             return $preValue;
  63.         }
  64.     }
  65.     $data $this->headerTag;
  66.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  67.         return $data->getPlain();
  68.     }
  69.     return $data;
  70. }
  71. /**
  72. * Set headerTag - Header Tag
  73. * @param string|null $headerTag
  74. * @return \Pimcore\Model\DataObject\Teaser
  75. */
  76. public function setHeaderTag(?string $headerTag)
  77. {
  78.     $this->headerTag $headerTag;
  79.     return $this;
  80. }
  81. /**
  82. * Get localizedfields - 
  83. * @return \Pimcore\Model\DataObject\Localizedfield|null
  84. */
  85. public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
  86. {
  87.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  88.         $preValue $this->preGetValue("localizedfields");
  89.         if ($preValue !== null) {
  90.             return $preValue;
  91.         }
  92.     }
  93.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  94.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  95.         return $data->getPlain();
  96.     }
  97.     return $data;
  98. }
  99. /**
  100. * Get Subtitle - Subtitel
  101. * @return string|null
  102. */
  103. public function getSubtitle($language null): ?string
  104. {
  105.     $data $this->getLocalizedfields()->getLocalizedValue("Subtitle"$language);
  106.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  107.         $preValue $this->preGetValue("Subtitle");
  108.         if ($preValue !== null) {
  109.             return $preValue;
  110.         }
  111.     }
  112.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  113.         return $data->getPlain();
  114.     }
  115.     return $data;
  116. }
  117. /**
  118. * Get Title - Titel
  119. * @return string|null
  120. */
  121. public function getTitle($language null): ?string
  122. {
  123.     $data $this->getLocalizedfields()->getLocalizedValue("Title"$language);
  124.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  125.         $preValue $this->preGetValue("Title");
  126.         if ($preValue !== null) {
  127.             return $preValue;
  128.         }
  129.     }
  130.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  131.         return $data->getPlain();
  132.     }
  133.     return $data;
  134. }
  135. /**
  136. * Get Text - Text
  137. * @return string|null
  138. */
  139. public function getText($language null): ?string
  140. {
  141.     $data $this->getLocalizedfields()->getLocalizedValue("Text"$language);
  142.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  143.         $preValue $this->preGetValue("Text");
  144.         if ($preValue !== null) {
  145.             return $preValue;
  146.         }
  147.     }
  148.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  149.         return $data->getPlain();
  150.     }
  151.     return $data;
  152. }
  153. /**
  154. * Get Link - Link
  155. * @return \Pimcore\Model\DataObject\Data\Link|null
  156. */
  157. public function getLink($language null): ?\Pimcore\Model\DataObject\Data\Link
  158. {
  159.     $data $this->getLocalizedfields()->getLocalizedValue("Link"$language);
  160.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  161.         $preValue $this->preGetValue("Link");
  162.         if ($preValue !== null) {
  163.             return $preValue;
  164.         }
  165.     }
  166.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  167.         return $data->getPlain();
  168.     }
  169.     return $data;
  170. }
  171. /**
  172. * Get badge_price - Preis des Badges
  173. * @return string|null
  174. */
  175. public function getBadge_price($language null): ?string
  176. {
  177.     $data $this->getLocalizedfields()->getLocalizedValue("badge_price"$language);
  178.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  179.         $preValue $this->preGetValue("badge_price");
  180.         if ($preValue !== null) {
  181.             return $preValue;
  182.         }
  183.     }
  184.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  185.         return $data->getPlain();
  186.     }
  187.     return $data;
  188. }
  189. /**
  190. * Get badge_text - Text für Badge
  191. * @return string|null
  192. */
  193. public function getBadge_text($language null): ?string
  194. {
  195.     $data $this->getLocalizedfields()->getLocalizedValue("badge_text"$language);
  196.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  197.         $preValue $this->preGetValue("badge_text");
  198.         if ($preValue !== null) {
  199.             return $preValue;
  200.         }
  201.     }
  202.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  203.         return $data->getPlain();
  204.     }
  205.     return $data;
  206. }
  207. /**
  208. * Set localizedfields - 
  209. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  210. * @return \Pimcore\Model\DataObject\Teaser
  211. */
  212. public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
  213. {
  214.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  215.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  216.     $currentData $this->getLocalizedfields();
  217.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  218.     $this->markFieldDirty("localizedfields"true);
  219.     $this->localizedfields $localizedfields;
  220.     return $this;
  221. }
  222. /**
  223. * Set Subtitle - Subtitel
  224. * @param string|null $Subtitle
  225. * @return \Pimcore\Model\DataObject\Teaser
  226. */
  227. public function setSubtitle (?string $Subtitle$language null)
  228. {
  229.     $isEqual false;
  230.     $this->getLocalizedfields()->setLocalizedValue("Subtitle"$Subtitle$language, !$isEqual);
  231.     return $this;
  232. }
  233. /**
  234. * Set Title - Titel
  235. * @param string|null $Title
  236. * @return \Pimcore\Model\DataObject\Teaser
  237. */
  238. public function setTitle (?string $Title$language null)
  239. {
  240.     $isEqual false;
  241.     $this->getLocalizedfields()->setLocalizedValue("Title"$Title$language, !$isEqual);
  242.     return $this;
  243. }
  244. /**
  245. * Set Text - Text
  246. * @param string|null $Text
  247. * @return \Pimcore\Model\DataObject\Teaser
  248. */
  249. public function setText (?string $Text$language null)
  250. {
  251.     $isEqual false;
  252.     $this->getLocalizedfields()->setLocalizedValue("Text"$Text$language, !$isEqual);
  253.     return $this;
  254. }
  255. /**
  256. * Set Link - Link
  257. * @param \Pimcore\Model\DataObject\Data\Link|null $Link
  258. * @return \Pimcore\Model\DataObject\Teaser
  259. */
  260. public function setLink (?\Pimcore\Model\DataObject\Data\Link $Link$language null)
  261. {
  262.     $isEqual false;
  263.     $this->getLocalizedfields()->setLocalizedValue("Link"$Link$language, !$isEqual);
  264.     return $this;
  265. }
  266. /**
  267. * Set badge_price - Preis des Badges
  268. * @param string|null $badge_price
  269. * @return \Pimcore\Model\DataObject\Teaser
  270. */
  271. public function setBadge_price (?string $badge_price$language null)
  272. {
  273.     $isEqual false;
  274.     $this->getLocalizedfields()->setLocalizedValue("badge_price"$badge_price$language, !$isEqual);
  275.     return $this;
  276. }
  277. /**
  278. * Set badge_text - Text für Badge
  279. * @param string|null $badge_text
  280. * @return \Pimcore\Model\DataObject\Teaser
  281. */
  282. public function setBadge_text (?string $badge_text$language null)
  283. {
  284.     $isEqual false;
  285.     $this->getLocalizedfields()->setLocalizedValue("badge_text"$badge_text$language, !$isEqual);
  286.     return $this;
  287. }
  288. /**
  289. * Get linkAsButton - Link als Button
  290. * @return bool|null
  291. */
  292. public function getLinkAsButton(): ?bool
  293. {
  294.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  295.         $preValue $this->preGetValue("linkAsButton");
  296.         if ($preValue !== null) {
  297.             return $preValue;
  298.         }
  299.     }
  300.     $data $this->linkAsButton;
  301.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  302.         return $data->getPlain();
  303.     }
  304.     return $data;
  305. }
  306. /**
  307. * Set linkAsButton - Link als Button
  308. * @param bool|null $linkAsButton
  309. * @return \Pimcore\Model\DataObject\Teaser
  310. */
  311. public function setLinkAsButton(?bool $linkAsButton)
  312. {
  313.     $this->linkAsButton $linkAsButton;
  314.     return $this;
  315. }
  316. /**
  317. * Get Image - Bild
  318. * @return \Pimcore\Model\Asset\Image|null
  319. */
  320. public function getImage(): ?\Pimcore\Model\Asset\Image
  321. {
  322.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  323.         $preValue $this->preGetValue("Image");
  324.         if ($preValue !== null) {
  325.             return $preValue;
  326.         }
  327.     }
  328.     $data $this->Image;
  329.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  330.         return $data->getPlain();
  331.     }
  332.     return $data;
  333. }
  334. /**
  335. * Set Image - Bild
  336. * @param \Pimcore\Model\Asset\Image|null $Image
  337. * @return \Pimcore\Model\DataObject\Teaser
  338. */
  339. public function setImage(?\Pimcore\Model\Asset\Image $Image)
  340. {
  341.     $this->Image $Image;
  342.     return $this;
  343. }
  344. /**
  345. * Get Video - Video
  346. * @return \Pimcore\Model\DataObject\Data\Video|null
  347. */
  348. public function getVideo(): ?\Pimcore\Model\DataObject\Data\Video
  349. {
  350.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  351.         $preValue $this->preGetValue("Video");
  352.         if ($preValue !== null) {
  353.             return $preValue;
  354.         }
  355.     }
  356.     $data $this->Video;
  357.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  358.         return $data->getPlain();
  359.     }
  360.     return $data;
  361. }
  362. /**
  363. * Set Video - Video
  364. * @param \Pimcore\Model\DataObject\Data\Video|null $Video
  365. * @return \Pimcore\Model\DataObject\Teaser
  366. */
  367. public function setVideo(?\Pimcore\Model\DataObject\Data\Video $Video)
  368. {
  369.     $this->Video $Video;
  370.     return $this;
  371. }
  372. }