var/classes/DataObject/SwipeSlider.php line 162

Open in your IDE?
  1. <?php
  2. /**
  3. * Inheritance: no
  4. * Variants: no
  5. *
  6. * Fields Summary:
  7. * - mobileImage [image]
  8. * - image [image]
  9. * - headline [textarea]
  10. * - text [wysiwyg]
  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\SwipeSlider\Listing getList(array $config = [])
  17. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByMobileImage($value, $limit = 0, $offset = 0, $objectTypes = null)
  18. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByImage($value, $limit = 0, $offset = 0, $objectTypes = null)
  19. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByHeadline($value, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByText($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. */
  22. class SwipeSlider extends Concrete
  23. {
  24. protected $o_classId = "SwipeSlider";
  25. protected $o_className = "SwipeSlider";
  26. protected $mobileImage;
  27. protected $image;
  28. protected $headline;
  29. protected $text;
  30. /**
  31. * @param array $values
  32. * @return \Pimcore\Model\DataObject\SwipeSlider
  33. */
  34. public static function create($values = array()) {
  35. $object = new static();
  36. $object->setValues($values);
  37. return $object;
  38. }
  39. /**
  40. * Get mobileImage - Mobile Image
  41. * @return \Pimcore\Model\Asset\Image|null
  42. */
  43. public function getMobileImage(): ?\Pimcore\Model\Asset\Image
  44. {
  45. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  46. $preValue = $this->preGetValue("mobileImage");
  47. if ($preValue !== null) {
  48. return $preValue;
  49. }
  50. }
  51. $data = $this->mobileImage;
  52. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  53. return $data->getPlain();
  54. }
  55. return $data;
  56. }
  57. /**
  58. * Set mobileImage - Mobile Image
  59. * @param \Pimcore\Model\Asset\Image|null $mobileImage
  60. * @return \Pimcore\Model\DataObject\SwipeSlider
  61. */
  62. public function setMobileImage(?\Pimcore\Model\Asset\Image $mobileImage)
  63. {
  64. $this->mobileImage = $mobileImage;
  65. return $this;
  66. }
  67. /**
  68. * Get image - Image
  69. * @return \Pimcore\Model\Asset\Image|null
  70. */
  71. public function getImage(): ?\Pimcore\Model\Asset\Image
  72. {
  73. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  74. $preValue = $this->preGetValue("image");
  75. if ($preValue !== null) {
  76. return $preValue;
  77. }
  78. }
  79. $data = $this->image;
  80. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  81. return $data->getPlain();
  82. }
  83. return $data;
  84. }
  85. /**
  86. * Set image - Image
  87. * @param \Pimcore\Model\Asset\Image|null $image
  88. * @return \Pimcore\Model\DataObject\SwipeSlider
  89. */
  90. public function setImage(?\Pimcore\Model\Asset\Image $image)
  91. {
  92. $this->image = $image;
  93. return $this;
  94. }
  95. /**
  96. * Get headline - Headline
  97. * @return string|null
  98. */
  99. public function getHeadline(): ?string
  100. {
  101. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  102. $preValue = $this->preGetValue("headline");
  103. if ($preValue !== null) {
  104. return $preValue;
  105. }
  106. }
  107. $data = $this->headline;
  108. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  109. return $data->getPlain();
  110. }
  111. return $data;
  112. }
  113. /**
  114. * Set headline - Headline
  115. * @param string|null $headline
  116. * @return \Pimcore\Model\DataObject\SwipeSlider
  117. */
  118. public function setHeadline(?string $headline)
  119. {
  120. $this->headline = $headline;
  121. return $this;
  122. }
  123. /**
  124. * Get text - Text
  125. * @return string|null
  126. */
  127. public function getText(): ?string
  128. {
  129. if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  130. $preValue = $this->preGetValue("text");
  131. if ($preValue !== null) {
  132. return $preValue;
  133. }
  134. }
  135. $data = $this->getClass()->getFieldDefinition("text")->preGetData($this);
  136. if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  137. return $data->getPlain();
  138. }
  139. return $data;
  140. }
  141. /**
  142. * Set text - Text
  143. * @param string|null $text
  144. * @return \Pimcore\Model\DataObject\SwipeSlider
  145. */
  146. public function setText(?string $text)
  147. {
  148. $this->text = $text;
  149. return $this;
  150. }
  151. }