var/classes/DataObject/IconTeaser.php line 27

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - localizedfields [localizedfields]
  8.  * -- text [wysiwyg]
  9.  * -- link [link]
  10.  * - icon [select]
  11.  */
  12. namespace Pimcore\Model\DataObject;
  13. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  14. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  15. /**
  16. * @method static \Pimcore\Model\DataObject\IconTeaser\Listing getList(array $config = [])
  17. * @method static \Pimcore\Model\DataObject\IconTeaser\Listing|\Pimcore\Model\DataObject\IconTeaser|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  18. * @method static \Pimcore\Model\DataObject\IconTeaser\Listing|\Pimcore\Model\DataObject\IconTeaser|null getByText($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  19. * @method static \Pimcore\Model\DataObject\IconTeaser\Listing|\Pimcore\Model\DataObject\IconTeaser|null getByLink($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\IconTeaser\Listing|\Pimcore\Model\DataObject\IconTeaser|null getByIcon($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. */
  22. class IconTeaser extends Concrete
  23. {
  24. protected $o_classId "1";
  25. protected $o_className "IconTeaser";
  26. protected $localizedfields;
  27. protected $icon;
  28. /**
  29. * @param array $values
  30. * @return \Pimcore\Model\DataObject\IconTeaser
  31. */
  32. public static function create($values = array()) {
  33.     $object = new static();
  34.     $object->setValues($values);
  35.     return $object;
  36. }
  37. /**
  38. * Get localizedfields - 
  39. * @return \Pimcore\Model\DataObject\Localizedfield|null
  40. */
  41. public function getLocalizedfields()
  42. {
  43.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  44.         $preValue $this->preGetValue("localizedfields");
  45.         if ($preValue !== null) {
  46.             return $preValue;
  47.         }
  48.     }
  49.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  50.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  51.         return $data->getPlain();
  52.     }
  53.     return $data;
  54. }
  55. /**
  56. * Get text - Text
  57. * @return string|null
  58. */
  59. public function getText($language null)
  60. {
  61.     $data $this->getLocalizedfields()->getLocalizedValue("text"$language);
  62.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  63.         $preValue $this->preGetValue("text");
  64.         if ($preValue !== null) {
  65.             return $preValue;
  66.         }
  67.     }
  68.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  69.         return $data->getPlain();
  70.     }
  71.     return $data;
  72. }
  73. /**
  74. * Get link - Link
  75. * @return \Pimcore\Model\DataObject\Data\Link|null
  76. */
  77. public function getLink($language null)
  78. {
  79.     $data $this->getLocalizedfields()->getLocalizedValue("link"$language);
  80.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  81.         $preValue $this->preGetValue("link");
  82.         if ($preValue !== null) {
  83.             return $preValue;
  84.         }
  85.     }
  86.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  87.         return $data->getPlain();
  88.     }
  89.     return $data;
  90. }
  91. /**
  92. * Set localizedfields - 
  93. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  94. * @return \Pimcore\Model\DataObject\IconTeaser
  95. */
  96. public function setLocalizedfields($localizedfields)
  97. {
  98.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  99.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  100.     $currentData $this->getLocalizedfields();
  101.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  102.     $this->markFieldDirty("localizedfields"true);
  103.     $this->localizedfields $localizedfields;
  104.     return $this;
  105. }
  106. /**
  107. * Set text - Text
  108. * @param string|null $text
  109. * @return \Pimcore\Model\DataObject\IconTeaser
  110. */
  111. public function setText ($text$language null)
  112. {
  113.     $isEqual false;
  114.     $this->getLocalizedfields()->setLocalizedValue("text"$text$language, !$isEqual);
  115.     return $this;
  116. }
  117. /**
  118. * Set link - Link
  119. * @param \Pimcore\Model\DataObject\Data\Link|null $link
  120. * @return \Pimcore\Model\DataObject\IconTeaser
  121. */
  122. public function setLink ($link$language null)
  123. {
  124.     $isEqual false;
  125.     $this->getLocalizedfields()->setLocalizedValue("link"$link$language, !$isEqual);
  126.     return $this;
  127. }
  128. /**
  129. * Get icon - Icon
  130. * @return string|null
  131. */
  132. public function getIcon()
  133. {
  134.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  135.         $preValue $this->preGetValue("icon");
  136.         if ($preValue !== null) {
  137.             return $preValue;
  138.         }
  139.     }
  140.     $data $this->icon;
  141.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  142.         return $data->getPlain();
  143.     }
  144.     return $data;
  145. }
  146. /**
  147. * Set icon - Icon
  148. * @param string|null $icon
  149. * @return \Pimcore\Model\DataObject\IconTeaser
  150. */
  151. public function setIcon($icon)
  152. {
  153.     $this->icon $icon;
  154.     return $this;
  155. }
  156. }