var/classes/DataObject/AlpsteinCategory.php line 31

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - sorting [numeric]
  8.  * - alpsteinKey [manyToManyRelation]
  9.  * - categoryId [input]
  10.  * - generalSolutionsId [input]
  11.  * - icon [image]
  12.  * - localizedfields [localizedfields]
  13.  * -- name [input]
  14.  */
  15. namespace Pimcore\Model\DataObject;
  16. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  17. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  18. /**
  19. * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing getList(array $config = [])
  20. * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getBySorting($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByAlpsteinKey($value, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByCategoryId($value, $limit = 0, $offset = 0, $objectTypes = null)
  23. * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByGeneralSolutionsId($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByIcon($value, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  27. */
  28. class AlpsteinCategory extends Concrete
  29. {
  30. protected $o_classId "AlpsteinCategory";
  31. protected $o_className "AlpsteinCategory";
  32. protected $sorting;
  33. protected $alpsteinKey;
  34. protected $categoryId;
  35. protected $generalSolutionsId;
  36. protected $icon;
  37. protected $localizedfields;
  38. /**
  39. * @param array $values
  40. * @return \Pimcore\Model\DataObject\AlpsteinCategory
  41. */
  42. public static function create($values = array()) {
  43.     $object = new static();
  44.     $object->setValues($values);
  45.     return $object;
  46. }
  47. /**
  48. * Get sorting - Sorting
  49. * @return float|null
  50. */
  51. public function getSorting()
  52. {
  53.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  54.         $preValue $this->preGetValue("sorting");
  55.         if ($preValue !== null) {
  56.             return $preValue;
  57.         }
  58.     }
  59.     $data $this->sorting;
  60.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  61.         return $data->getPlain();
  62.     }
  63.     return $data;
  64. }
  65. /**
  66. * Set sorting - Sorting
  67. * @param float|null $sorting
  68. * @return \Pimcore\Model\DataObject\AlpsteinCategory
  69. */
  70. public function setSorting($sorting)
  71. {
  72.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  73.     $fd $this->getClass()->getFieldDefinition("sorting");
  74.     $this->sorting $fd->preSetData($this$sorting);
  75.     return $this;
  76. }
  77. /**
  78. * Get alpsteinKey - Alpstein Key
  79. * @return \Pimcore\Model\DataObject\AlpsteinKey[]
  80. */
  81. public function getAlpsteinKey()
  82. {
  83.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  84.         $preValue $this->preGetValue("alpsteinKey");
  85.         if ($preValue !== null) {
  86.             return $preValue;
  87.         }
  88.     }
  89.     $data $this->getClass()->getFieldDefinition("alpsteinKey")->preGetData($this);
  90.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  91.         return $data->getPlain();
  92.     }
  93.     return $data;
  94. }
  95. /**
  96. * Set alpsteinKey - Alpstein Key
  97. * @param \Pimcore\Model\DataObject\AlpsteinKey[] $alpsteinKey
  98. * @return \Pimcore\Model\DataObject\AlpsteinCategory
  99. */
  100. public function setAlpsteinKey($alpsteinKey)
  101. {
  102.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyRelation $fd */
  103.     $fd $this->getClass()->getFieldDefinition("alpsteinKey");
  104.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  105.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  106.     $currentData $this->getAlpsteinKey();
  107.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  108.     $isEqual $fd->isEqual($currentData$alpsteinKey);
  109.     if (!$isEqual) {
  110.         $this->markFieldDirty("alpsteinKey"true);
  111.     }
  112.     $this->alpsteinKey $fd->preSetData($this$alpsteinKey);
  113.     return $this;
  114. }
  115. /**
  116. * Get categoryId - Category ID
  117. * @return string|null
  118. */
  119. public function getCategoryId()
  120. {
  121.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  122.         $preValue $this->preGetValue("categoryId");
  123.         if ($preValue !== null) {
  124.             return $preValue;
  125.         }
  126.     }
  127.     $data $this->categoryId;
  128.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  129.         return $data->getPlain();
  130.     }
  131.     return $data;
  132. }
  133. /**
  134. * Set categoryId - Category ID
  135. * @param string|null $categoryId
  136. * @return \Pimcore\Model\DataObject\AlpsteinCategory
  137. */
  138. public function setCategoryId($categoryId)
  139. {
  140.     $this->categoryId $categoryId;
  141.     return $this;
  142. }
  143. /**
  144. * Get generalSolutionsId - General Solutions ID
  145. * @return string|null
  146. */
  147. public function getGeneralSolutionsId()
  148. {
  149.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  150.         $preValue $this->preGetValue("generalSolutionsId");
  151.         if ($preValue !== null) {
  152.             return $preValue;
  153.         }
  154.     }
  155.     $data $this->generalSolutionsId;
  156.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  157.         return $data->getPlain();
  158.     }
  159.     return $data;
  160. }
  161. /**
  162. * Set generalSolutionsId - General Solutions ID
  163. * @param string|null $generalSolutionsId
  164. * @return \Pimcore\Model\DataObject\AlpsteinCategory
  165. */
  166. public function setGeneralSolutionsId($generalSolutionsId)
  167. {
  168.     $this->generalSolutionsId $generalSolutionsId;
  169.     return $this;
  170. }
  171. /**
  172. * Get icon - Icon
  173. * @return \Pimcore\Model\Asset\Image|null
  174. */
  175. public function getIcon()
  176. {
  177.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  178.         $preValue $this->preGetValue("icon");
  179.         if ($preValue !== null) {
  180.             return $preValue;
  181.         }
  182.     }
  183.     $data $this->icon;
  184.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  185.         return $data->getPlain();
  186.     }
  187.     return $data;
  188. }
  189. /**
  190. * Set icon - Icon
  191. * @param \Pimcore\Model\Asset\Image|null $icon
  192. * @return \Pimcore\Model\DataObject\AlpsteinCategory
  193. */
  194. public function setIcon($icon)
  195. {
  196.     $this->icon $icon;
  197.     return $this;
  198. }
  199. /**
  200. * Get localizedfields - 
  201. * @return \Pimcore\Model\DataObject\Localizedfield|null
  202. */
  203. public function getLocalizedfields()
  204. {
  205.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  206.         $preValue $this->preGetValue("localizedfields");
  207.         if ($preValue !== null) {
  208.             return $preValue;
  209.         }
  210.     }
  211.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  212.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  213.         return $data->getPlain();
  214.     }
  215.     return $data;
  216. }
  217. /**
  218. * Get name - Name
  219. * @return string|null
  220. */
  221. public function getName($language null)
  222. {
  223.     $data $this->getLocalizedfields()->getLocalizedValue("name"$language);
  224.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  225.         $preValue $this->preGetValue("name");
  226.         if ($preValue !== null) {
  227.             return $preValue;
  228.         }
  229.     }
  230.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  231.         return $data->getPlain();
  232.     }
  233.     return $data;
  234. }
  235. /**
  236. * Set localizedfields - 
  237. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  238. * @return \Pimcore\Model\DataObject\AlpsteinCategory
  239. */
  240. public function setLocalizedfields($localizedfields)
  241. {
  242.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  243.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  244.     $currentData $this->getLocalizedfields();
  245.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  246.     $this->markFieldDirty("localizedfields"true);
  247.     $this->localizedfields $localizedfields;
  248.     return $this;
  249. }
  250. /**
  251. * Set name - Name
  252. * @param string|null $name
  253. * @return \Pimcore\Model\DataObject\AlpsteinCategory
  254. */
  255. public function setName ($name$language null)
  256. {
  257.     $isEqual false;
  258.     $this->getLocalizedfields()->setLocalizedValue("name"$name$language, !$isEqual);
  259.     return $this;
  260. }
  261. }