config/pimcore/classes/DataObject/Resort.php line 35

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - infosnowId [input]
  8.  * - localizedfields [localizedfields]
  9.  * -- name [input]
  10.  * -- snippet [manyToOneRelation]
  11.  * - openLiftCount [numeric]
  12.  * - totalLiftCount [numeric]
  13.  * - openSlopeLength [numeric]
  14.  * - totalSlopeLength [numeric]
  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\Resort\Listing getList(array $config = [])
  21. * @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByInfosnowId($value, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  23. * @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getBySnippet($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByOpenLiftCount($value, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByTotalLiftCount($value, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByOpenSlopeLength($value, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\Resort\Listing|\Pimcore\Model\DataObject\Resort|null getByTotalSlopeLength($value, $limit = 0, $offset = 0, $objectTypes = null)
  29. */
  30. class Resort extends Concrete
  31. {
  32. protected $o_classId "Resort";
  33. protected $o_className "Resort";
  34. protected $infosnowId;
  35. protected $localizedfields;
  36. protected $openLiftCount;
  37. protected $totalLiftCount;
  38. protected $openSlopeLength;
  39. protected $totalSlopeLength;
  40. /**
  41. * @param array $values
  42. * @return \Pimcore\Model\DataObject\Resort
  43. */
  44. public static function create($values = array()) {
  45.     $object = new static();
  46.     $object->setValues($values);
  47.     return $object;
  48. }
  49. /**
  50. * Get infosnowId - Infosnow Id
  51. * @return string|null
  52. */
  53. public function getInfosnowId(): ?string
  54. {
  55.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  56.         $preValue $this->preGetValue("infosnowId");
  57.         if ($preValue !== null) {
  58.             return $preValue;
  59.         }
  60.     }
  61.     $data $this->infosnowId;
  62.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  63.         return $data->getPlain();
  64.     }
  65.     return $data;
  66. }
  67. /**
  68. * Set infosnowId - Infosnow Id
  69. * @param string|null $infosnowId
  70. * @return \Pimcore\Model\DataObject\Resort
  71. */
  72. public function setInfosnowId(?string $infosnowId)
  73. {
  74.     $this->infosnowId $infosnowId;
  75.     return $this;
  76. }
  77. /**
  78. * Get localizedfields - 
  79. * @return \Pimcore\Model\DataObject\Localizedfield|null
  80. */
  81. public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
  82. {
  83.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  84.         $preValue $this->preGetValue("localizedfields");
  85.         if ($preValue !== null) {
  86.             return $preValue;
  87.         }
  88.     }
  89.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  90.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  91.         return $data->getPlain();
  92.     }
  93.     return $data;
  94. }
  95. /**
  96. * Get name - Name
  97. * @return string|null
  98. */
  99. public function getName($language null): ?string
  100. {
  101.     $data $this->getLocalizedfields()->getLocalizedValue("name"$language);
  102.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  103.         $preValue $this->preGetValue("name");
  104.         if ($preValue !== null) {
  105.             return $preValue;
  106.         }
  107.     }
  108.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  109.         return $data->getPlain();
  110.     }
  111.     return $data;
  112. }
  113. /**
  114. * Get snippet - Card Teaser Snippet
  115. * @return \Pimcore\Model\Document\Snippet|null
  116. */
  117. public function getSnippet($language null): ?\Pimcore\Model\Element\AbstractElement
  118. {
  119.     $data $this->getLocalizedfields()->getLocalizedValue("snippet"$language);
  120.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  121.         $preValue $this->preGetValue("snippet");
  122.         if ($preValue !== null) {
  123.             return $preValue;
  124.         }
  125.     }
  126.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  127.         return $data->getPlain();
  128.     }
  129.     return $data;
  130. }
  131. /**
  132. * Set localizedfields - 
  133. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  134. * @return \Pimcore\Model\DataObject\Resort
  135. */
  136. public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
  137. {
  138.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  139.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  140.     $currentData $this->getLocalizedfields();
  141.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  142.     $this->markFieldDirty("localizedfields"true);
  143.     $this->localizedfields $localizedfields;
  144.     return $this;
  145. }
  146. /**
  147. * Set name - Name
  148. * @param string|null $name
  149. * @return \Pimcore\Model\DataObject\Resort
  150. */
  151. public function setName (?string $name$language null)
  152. {
  153.     $isEqual false;
  154.     $this->getLocalizedfields()->setLocalizedValue("name"$name$language, !$isEqual);
  155.     return $this;
  156. }
  157. /**
  158. * Set snippet - Card Teaser Snippet
  159. * @param \Pimcore\Model\Document\Snippet|null $snippet
  160. * @return \Pimcore\Model\DataObject\Resort
  161. */
  162. public function setSnippet (?\Pimcore\Model\Element\AbstractElement $snippet$language null)
  163. {
  164.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("snippet");
  165.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  166.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  167.     $currentData $this->getSnippet($language);
  168.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  169.     $isEqual $fd->isEqual($currentData$snippet);
  170.     if (!$isEqual) {
  171.         $this->markFieldDirty("snippet"true);
  172.     }
  173.     $this->getLocalizedfields()->setLocalizedValue("snippet"$snippet$language, !$isEqual);
  174.     return $this;
  175. }
  176. /**
  177. * Get openLiftCount - Open Lift Count
  178. * @return float|null
  179. */
  180. public function getOpenLiftCount(): ?float
  181. {
  182.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  183.         $preValue $this->preGetValue("openLiftCount");
  184.         if ($preValue !== null) {
  185.             return $preValue;
  186.         }
  187.     }
  188.     $data $this->openLiftCount;
  189.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  190.         return $data->getPlain();
  191.     }
  192.     return $data;
  193. }
  194. /**
  195. * Set openLiftCount - Open Lift Count
  196. * @param float|null $openLiftCount
  197. * @return \Pimcore\Model\DataObject\Resort
  198. */
  199. public function setOpenLiftCount(?float $openLiftCount)
  200. {
  201.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  202.     $fd $this->getClass()->getFieldDefinition("openLiftCount");
  203.     $this->openLiftCount $fd->preSetData($this$openLiftCount);
  204.     return $this;
  205. }
  206. /**
  207. * Get totalLiftCount - Total Lift Count
  208. * @return float|null
  209. */
  210. public function getTotalLiftCount(): ?float
  211. {
  212.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  213.         $preValue $this->preGetValue("totalLiftCount");
  214.         if ($preValue !== null) {
  215.             return $preValue;
  216.         }
  217.     }
  218.     $data $this->totalLiftCount;
  219.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  220.         return $data->getPlain();
  221.     }
  222.     return $data;
  223. }
  224. /**
  225. * Set totalLiftCount - Total Lift Count
  226. * @param float|null $totalLiftCount
  227. * @return \Pimcore\Model\DataObject\Resort
  228. */
  229. public function setTotalLiftCount(?float $totalLiftCount)
  230. {
  231.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  232.     $fd $this->getClass()->getFieldDefinition("totalLiftCount");
  233.     $this->totalLiftCount $fd->preSetData($this$totalLiftCount);
  234.     return $this;
  235. }
  236. /**
  237. * Get openSlopeLength - Open Slope Length
  238. * @return float|null
  239. */
  240. public function getOpenSlopeLength(): ?float
  241. {
  242.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  243.         $preValue $this->preGetValue("openSlopeLength");
  244.         if ($preValue !== null) {
  245.             return $preValue;
  246.         }
  247.     }
  248.     $data $this->openSlopeLength;
  249.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  250.         return $data->getPlain();
  251.     }
  252.     return $data;
  253. }
  254. /**
  255. * Set openSlopeLength - Open Slope Length
  256. * @param float|null $openSlopeLength
  257. * @return \Pimcore\Model\DataObject\Resort
  258. */
  259. public function setOpenSlopeLength(?float $openSlopeLength)
  260. {
  261.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  262.     $fd $this->getClass()->getFieldDefinition("openSlopeLength");
  263.     $this->openSlopeLength $fd->preSetData($this$openSlopeLength);
  264.     return $this;
  265. }
  266. /**
  267. * Get totalSlopeLength - Total Slope Length
  268. * @return float|null
  269. */
  270. public function getTotalSlopeLength(): ?float
  271. {
  272.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  273.         $preValue $this->preGetValue("totalSlopeLength");
  274.         if ($preValue !== null) {
  275.             return $preValue;
  276.         }
  277.     }
  278.     $data $this->totalSlopeLength;
  279.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  280.         return $data->getPlain();
  281.     }
  282.     return $data;
  283. }
  284. /**
  285. * Set totalSlopeLength - Total Slope Length
  286. * @param float|null $totalSlopeLength
  287. * @return \Pimcore\Model\DataObject\Resort
  288. */
  289. public function setTotalSlopeLength(?float $totalSlopeLength)
  290. {
  291.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  292.     $fd $this->getClass()->getFieldDefinition("totalSlopeLength");
  293.     $this->totalSlopeLength $fd->preSetData($this$totalSlopeLength);
  294.     return $this;
  295. }
  296. }