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