var/classes/DataObject/AccordionElement.php line 27

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - title [input]
  8.  * - subtitle [input]
  9.  * - text [wysiwyg]
  10.  * - contentElemente [fieldcollections]
  11.  * - link [link]
  12.  */
  13. namespace Pimcore\Model\DataObject;
  14. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  15. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  16. /**
  17. * @method static \Pimcore\Model\DataObject\AccordionElement\Listing getList(array $config = [])
  18. * @method static \Pimcore\Model\DataObject\AccordionElement\Listing|\Pimcore\Model\DataObject\AccordionElement|null getByTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  19. * @method static \Pimcore\Model\DataObject\AccordionElement\Listing|\Pimcore\Model\DataObject\AccordionElement|null getBySubtitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\AccordionElement\Listing|\Pimcore\Model\DataObject\AccordionElement|null getByText($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. */
  22. class AccordionElement extends Concrete
  23. {
  24. protected $o_classId "AccordionElement";
  25. protected $o_className "AccordionElement";
  26. protected $title;
  27. protected $subtitle;
  28. protected $text;
  29. protected $contentElemente;
  30. protected $link;
  31. /**
  32. * @param array $values
  33. * @return \Pimcore\Model\DataObject\AccordionElement
  34. */
  35. public static function create($values = array()) {
  36.     $object = new static();
  37.     $object->setValues($values);
  38.     return $object;
  39. }
  40. /**
  41. * Get title - Title
  42. * @return string|null
  43. */
  44. public function getTitle(): ?string
  45. {
  46.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  47.         $preValue $this->preGetValue("title");
  48.         if ($preValue !== null) {
  49.             return $preValue;
  50.         }
  51.     }
  52.     $data $this->title;
  53.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  54.         return $data->getPlain();
  55.     }
  56.     return $data;
  57. }
  58. /**
  59. * Set title - Title
  60. * @param string|null $title
  61. * @return \Pimcore\Model\DataObject\AccordionElement
  62. */
  63. public function setTitle(?string $title)
  64. {
  65.     $this->title $title;
  66.     return $this;
  67. }
  68. /**
  69. * Get subtitle - Subtitle
  70. * @return string|null
  71. */
  72. public function getSubtitle(): ?string
  73. {
  74.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  75.         $preValue $this->preGetValue("subtitle");
  76.         if ($preValue !== null) {
  77.             return $preValue;
  78.         }
  79.     }
  80.     $data $this->subtitle;
  81.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  82.         return $data->getPlain();
  83.     }
  84.     return $data;
  85. }
  86. /**
  87. * Set subtitle - Subtitle
  88. * @param string|null $subtitle
  89. * @return \Pimcore\Model\DataObject\AccordionElement
  90. */
  91. public function setSubtitle(?string $subtitle)
  92. {
  93.     $this->subtitle $subtitle;
  94.     return $this;
  95. }
  96. /**
  97. * Get text - Text
  98. * @return string|null
  99. */
  100. public function getText(): ?string
  101. {
  102.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  103.         $preValue $this->preGetValue("text");
  104.         if ($preValue !== null) {
  105.             return $preValue;
  106.         }
  107.     }
  108.     $data $this->getClass()->getFieldDefinition("text")->preGetData($this);
  109.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  110.         return $data->getPlain();
  111.     }
  112.     return $data;
  113. }
  114. /**
  115. * Set text - Text
  116. * @param string|null $text
  117. * @return \Pimcore\Model\DataObject\AccordionElement
  118. */
  119. public function setText(?string $text)
  120. {
  121.     $this->text $text;
  122.     return $this;
  123. }
  124. /**
  125. * @return \Pimcore\Model\DataObject\Fieldcollection|null
  126. */
  127. public function getContentElemente(): ?\Pimcore\Model\DataObject\Fieldcollection
  128. {
  129.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  130.         $preValue $this->preGetValue("contentElemente");
  131.         if ($preValue !== null) {
  132.             return $preValue;
  133.         }
  134.     }
  135.     $data $this->getClass()->getFieldDefinition("contentElemente")->preGetData($this);
  136.     return $data;
  137. }
  138. /**
  139. * Set contentElemente - Content Elemente
  140. * @param \Pimcore\Model\DataObject\Fieldcollection|null $contentElemente
  141. * @return \Pimcore\Model\DataObject\AccordionElement
  142. */
  143. public function setContentElemente(?\Pimcore\Model\DataObject\Fieldcollection $contentElemente)
  144. {
  145.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Fieldcollections $fd */
  146.     $fd $this->getClass()->getFieldDefinition("contentElemente");
  147.     $this->contentElemente $fd->preSetData($this$contentElemente);
  148.     return $this;
  149. }
  150. /**
  151. * Get link - Link
  152. * @return \Pimcore\Model\DataObject\Data\Link|null
  153. */
  154. public function getLink(): ?\Pimcore\Model\DataObject\Data\Link
  155. {
  156.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  157.         $preValue $this->preGetValue("link");
  158.         if ($preValue !== null) {
  159.             return $preValue;
  160.         }
  161.     }
  162.     $data $this->link;
  163.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  164.         return $data->getPlain();
  165.     }
  166.     return $data;
  167. }
  168. /**
  169. * Set link - Link
  170. * @param \Pimcore\Model\DataObject\Data\Link|null $link
  171. * @return \Pimcore\Model\DataObject\AccordionElement
  172. */
  173. public function setLink(?\Pimcore\Model\DataObject\Data\Link $link)
  174. {
  175.     $this->link $link;
  176.     return $this;
  177. }
  178. }