var/classes/DataObject/ServiceClass.php line 38

Open in your IDE?
  1. <?php
  2. /**
  3. * Inheritance: no
  4. * Variants: no
  5. Fields Summary:
  6. - Url [input]
  7. - Title [input]
  8. - Tags [input]
  9. - TeaserDescription [textarea]
  10. - TeaserImg [image]
  11. - Area [select]
  12. - MetaTitle [input]
  13. - MetaDescription [textarea]
  14. - Snipped [manyToOneRelation]
  15. */
  16. namespace Pimcore\Model\DataObject;
  17. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  18. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  19. /**
  20. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing getList(array $config = [])
  21. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getByUrl($value, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getByTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  23. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getByTags($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getByTeaserDescription($value, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getByTeaserImg($value, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getByArea($value, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getByMetaTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getByMetaDescription($value, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\ServiceClass\Listing|\Pimcore\Model\DataObject\ServiceClass|null getBySnipped($value, $limit = 0, $offset = 0, $objectTypes = null)
  30. */
  31. class ServiceClass extends Concrete
  32. {
  33. protected $o_classId "3";
  34. protected $o_className "ServiceClass";
  35. protected $Url;
  36. protected $Title;
  37. protected $Tags;
  38. protected $TeaserDescription;
  39. protected $TeaserImg;
  40. protected $Area;
  41. protected $MetaTitle;
  42. protected $MetaDescription;
  43. protected $Snipped;
  44. /**
  45. * @param array $values
  46. * @return \Pimcore\Model\DataObject\ServiceClass
  47. */
  48. public static function create($values = array()) {
  49.     $object = new static();
  50.     $object->setValues($values);
  51.     return $object;
  52. }
  53. /**
  54. * Get Url - URL-Path
  55. * @return string|null
  56. */
  57. public function getUrl(): ?string
  58. {
  59.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  60.         $preValue $this->preGetValue("Url");
  61.         if ($preValue !== null) {
  62.             return $preValue;
  63.         }
  64.     }
  65.     $data $this->Url;
  66.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  67.         return $data->getPlain();
  68.     }
  69.     return $data;
  70. }
  71. /**
  72. * Set Url - URL-Path
  73. * @param string|null $Url
  74. * @return \Pimcore\Model\DataObject\ServiceClass
  75. */
  76. public function setUrl(?string $Url)
  77. {
  78.     $this->Url $Url;
  79.     return $this;
  80. }
  81. /**
  82. * Get Title - Title
  83. * @return string|null
  84. */
  85. public function getTitle(): ?string
  86. {
  87.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  88.         $preValue $this->preGetValue("Title");
  89.         if ($preValue !== null) {
  90.             return $preValue;
  91.         }
  92.     }
  93.     $data $this->Title;
  94.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  95.         return $data->getPlain();
  96.     }
  97.     return $data;
  98. }
  99. /**
  100. * Set Title - Title
  101. * @param string|null $Title
  102. * @return \Pimcore\Model\DataObject\ServiceClass
  103. */
  104. public function setTitle(?string $Title)
  105. {
  106.     $this->Title $Title;
  107.     return $this;
  108. }
  109. /**
  110. * Get Tags - Tags
  111. * @return string|null
  112. */
  113. public function getTags(): ?string
  114. {
  115.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  116.         $preValue $this->preGetValue("Tags");
  117.         if ($preValue !== null) {
  118.             return $preValue;
  119.         }
  120.     }
  121.     $data $this->Tags;
  122.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  123.         return $data->getPlain();
  124.     }
  125.     return $data;
  126. }
  127. /**
  128. * Set Tags - Tags
  129. * @param string|null $Tags
  130. * @return \Pimcore\Model\DataObject\ServiceClass
  131. */
  132. public function setTags(?string $Tags)
  133. {
  134.     $this->Tags $Tags;
  135.     return $this;
  136. }
  137. /**
  138. * Get TeaserDescription - Teaser Description
  139. * @return string|null
  140. */
  141. public function getTeaserDescription(): ?string
  142. {
  143.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  144.         $preValue $this->preGetValue("TeaserDescription");
  145.         if ($preValue !== null) {
  146.             return $preValue;
  147.         }
  148.     }
  149.     $data $this->TeaserDescription;
  150.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  151.         return $data->getPlain();
  152.     }
  153.     return $data;
  154. }
  155. /**
  156. * Set TeaserDescription - Teaser Description
  157. * @param string|null $TeaserDescription
  158. * @return \Pimcore\Model\DataObject\ServiceClass
  159. */
  160. public function setTeaserDescription(?string $TeaserDescription)
  161. {
  162.     $this->TeaserDescription $TeaserDescription;
  163.     return $this;
  164. }
  165. /**
  166. * Get TeaserImg - Teaser Image
  167. * @return \Pimcore\Model\Asset\Image|null
  168. */
  169. public function getTeaserImg(): ?\Pimcore\Model\Asset\Image
  170. {
  171.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  172.         $preValue $this->preGetValue("TeaserImg");
  173.         if ($preValue !== null) {
  174.             return $preValue;
  175.         }
  176.     }
  177.     $data $this->TeaserImg;
  178.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  179.         return $data->getPlain();
  180.     }
  181.     return $data;
  182. }
  183. /**
  184. * Set TeaserImg - Teaser Image
  185. * @param \Pimcore\Model\Asset\Image|null $TeaserImg
  186. * @return \Pimcore\Model\DataObject\ServiceClass
  187. */
  188. public function setTeaserImg(?\Pimcore\Model\Asset\Image $TeaserImg)
  189. {
  190.     $this->TeaserImg $TeaserImg;
  191.     return $this;
  192. }
  193. /**
  194. * Get Area - Area
  195. * @return string|null
  196. */
  197. public function getArea(): ?string
  198. {
  199.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  200.         $preValue $this->preGetValue("Area");
  201.         if ($preValue !== null) {
  202.             return $preValue;
  203.         }
  204.     }
  205.     $data $this->Area;
  206.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  207.         return $data->getPlain();
  208.     }
  209.     return $data;
  210. }
  211. /**
  212. * Set Area - Area
  213. * @param string|null $Area
  214. * @return \Pimcore\Model\DataObject\ServiceClass
  215. */
  216. public function setArea(?string $Area)
  217. {
  218.     $this->Area $Area;
  219.     return $this;
  220. }
  221. /**
  222. * Get MetaTitle - Meta Title
  223. * @return string|null
  224. */
  225. public function getMetaTitle(): ?string
  226. {
  227.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  228.         $preValue $this->preGetValue("MetaTitle");
  229.         if ($preValue !== null) {
  230.             return $preValue;
  231.         }
  232.     }
  233.     $data $this->MetaTitle;
  234.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  235.         return $data->getPlain();
  236.     }
  237.     return $data;
  238. }
  239. /**
  240. * Set MetaTitle - Meta Title
  241. * @param string|null $MetaTitle
  242. * @return \Pimcore\Model\DataObject\ServiceClass
  243. */
  244. public function setMetaTitle(?string $MetaTitle)
  245. {
  246.     $this->MetaTitle $MetaTitle;
  247.     return $this;
  248. }
  249. /**
  250. * Get MetaDescription - Meta Description
  251. * @return string|null
  252. */
  253. public function getMetaDescription(): ?string
  254. {
  255.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  256.         $preValue $this->preGetValue("MetaDescription");
  257.         if ($preValue !== null) {
  258.             return $preValue;
  259.         }
  260.     }
  261.     $data $this->MetaDescription;
  262.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  263.         return $data->getPlain();
  264.     }
  265.     return $data;
  266. }
  267. /**
  268. * Set MetaDescription - Meta Description
  269. * @param string|null $MetaDescription
  270. * @return \Pimcore\Model\DataObject\ServiceClass
  271. */
  272. public function setMetaDescription(?string $MetaDescription)
  273. {
  274.     $this->MetaDescription $MetaDescription;
  275.     return $this;
  276. }
  277. /**
  278. * Get Snipped - Snipped
  279. * @return \Pimcore\Model\Document\Snippet|null
  280. */
  281. public function getSnipped(): ?\Pimcore\Model\Element\AbstractElement
  282. {
  283.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  284.         $preValue $this->preGetValue("Snipped");
  285.         if ($preValue !== null) {
  286.             return $preValue;
  287.         }
  288.     }
  289.     $data $this->getClass()->getFieldDefinition("Snipped")->preGetData($this);
  290.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  291.         return $data->getPlain();
  292.     }
  293.     return $data;
  294. }
  295. /**
  296. * Set Snipped - Snipped
  297. * @param \Pimcore\Model\Document\Snippet $Snipped
  298. * @return \Pimcore\Model\DataObject\ServiceClass
  299. */
  300. public function setSnipped(?\Pimcore\Model\Element\AbstractElement $Snipped)
  301. {
  302.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  303.     $fd $this->getClass()->getFieldDefinition("Snipped");
  304.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  305.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  306.     $currentData $this->getSnipped();
  307.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  308.     $isEqual $fd->isEqual($currentData$Snipped);
  309.     if (!$isEqual) {
  310.         $this->markFieldDirty("Snipped"true);
  311.     }
  312.     $this->Snipped $fd->preSetData($this$Snipped);
  313.     return $this;
  314. }
  315. }