var/classes/DataObject/SwipeSlider.php line 29

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - video [manyToOneRelation]
  8.  * - image [image]
  9.  * - headline [wysiwyg]
  10.  * - headlineMobile [wysiwyg]
  11.  * - text [wysiwyg]
  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\SwipeSlider\Listing getList(array $config = [])
  18. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByVideo($value, $limit = 0, $offset = 0, $objectTypes = null)
  19. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByImage($value, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByHeadline($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByHeadlineMobile($value, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\SwipeSlider\Listing|\Pimcore\Model\DataObject\SwipeSlider|null getByText($value, $limit = 0, $offset = 0, $objectTypes = null)
  23. */
  24. class SwipeSlider extends Concrete
  25. {
  26. protected $o_classId "SwipeSlider";
  27. protected $o_className "SwipeSlider";
  28. protected $video;
  29. protected $image;
  30. protected $headline;
  31. protected $headlineMobile;
  32. protected $text;
  33. /**
  34. * @param array $values
  35. * @return \Pimcore\Model\DataObject\SwipeSlider
  36. */
  37. public static function create($values = array()) {
  38.     $object = new static();
  39.     $object->setValues($values);
  40.     return $object;
  41. }
  42. /**
  43. * Get video - Video
  44. * @return \Pimcore\Model\Asset\Video|null
  45. */
  46. public function getVideo(): ?\Pimcore\Model\Element\AbstractElement
  47. {
  48.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  49.         $preValue $this->preGetValue("video");
  50.         if ($preValue !== null) {
  51.             return $preValue;
  52.         }
  53.     }
  54.     $data $this->getClass()->getFieldDefinition("video")->preGetData($this);
  55.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  56.         return $data->getPlain();
  57.     }
  58.     return $data;
  59. }
  60. /**
  61. * Set video - Video
  62. * @param \Pimcore\Model\Asset\Video|null $video
  63. * @return \Pimcore\Model\DataObject\SwipeSlider
  64. */
  65. public function setVideo(?\Pimcore\Model\Element\AbstractElement $video)
  66. {
  67.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  68.     $fd $this->getClass()->getFieldDefinition("video");
  69.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  70.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  71.     $currentData $this->getVideo();
  72.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  73.     $isEqual $fd->isEqual($currentData$video);
  74.     if (!$isEqual) {
  75.         $this->markFieldDirty("video"true);
  76.     }
  77.     $this->video $fd->preSetData($this$video);
  78.     return $this;
  79. }
  80. /**
  81. * Get image - Image
  82. * @return \Pimcore\Model\Asset\Image|null
  83. */
  84. public function getImage(): ?\Pimcore\Model\Asset\Image
  85. {
  86.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  87.         $preValue $this->preGetValue("image");
  88.         if ($preValue !== null) {
  89.             return $preValue;
  90.         }
  91.     }
  92.     $data $this->image;
  93.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  94.         return $data->getPlain();
  95.     }
  96.     return $data;
  97. }
  98. /**
  99. * Set image - Image
  100. * @param \Pimcore\Model\Asset\Image|null $image
  101. * @return \Pimcore\Model\DataObject\SwipeSlider
  102. */
  103. public function setImage(?\Pimcore\Model\Asset\Image $image)
  104. {
  105.     $this->image $image;
  106.     return $this;
  107. }
  108. /**
  109. * Get headline - Headline
  110. * @return string|null
  111. */
  112. public function getHeadline(): ?string
  113. {
  114.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  115.         $preValue $this->preGetValue("headline");
  116.         if ($preValue !== null) {
  117.             return $preValue;
  118.         }
  119.     }
  120.     $data $this->getClass()->getFieldDefinition("headline")->preGetData($this);
  121.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  122.         return $data->getPlain();
  123.     }
  124.     return $data;
  125. }
  126. /**
  127. * Set headline - Headline
  128. * @param string|null $headline
  129. * @return \Pimcore\Model\DataObject\SwipeSlider
  130. */
  131. public function setHeadline(?string $headline)
  132. {
  133.     $this->headline $headline;
  134.     return $this;
  135. }
  136. /**
  137. * Get headlineMobile - Headline Mobile
  138. * @return string|null
  139. */
  140. public function getHeadlineMobile(): ?string
  141. {
  142.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  143.         $preValue $this->preGetValue("headlineMobile");
  144.         if ($preValue !== null) {
  145.             return $preValue;
  146.         }
  147.     }
  148.     $data $this->getClass()->getFieldDefinition("headlineMobile")->preGetData($this);
  149.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  150.         return $data->getPlain();
  151.     }
  152.     return $data;
  153. }
  154. /**
  155. * Set headlineMobile - Headline Mobile
  156. * @param string|null $headlineMobile
  157. * @return \Pimcore\Model\DataObject\SwipeSlider
  158. */
  159. public function setHeadlineMobile(?string $headlineMobile)
  160. {
  161.     $this->headlineMobile $headlineMobile;
  162.     return $this;
  163. }
  164. /**
  165. * Get text - Text
  166. * @return string|null
  167. */
  168. public function getText(): ?string
  169. {
  170.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  171.         $preValue $this->preGetValue("text");
  172.         if ($preValue !== null) {
  173.             return $preValue;
  174.         }
  175.     }
  176.     $data $this->getClass()->getFieldDefinition("text")->preGetData($this);
  177.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  178.         return $data->getPlain();
  179.     }
  180.     return $data;
  181. }
  182. /**
  183. * Set text - Text
  184. * @param string|null $text
  185. * @return \Pimcore\Model\DataObject\SwipeSlider
  186. */
  187. public function setText(?string $text)
  188. {
  189.     $this->text $text;
  190.     return $this;
  191. }
  192. }