- <?php
- /**
-  * Inheritance: no
-  * Variants: no
-  *
-  * Fields Summary:
-  * - sorting [numeric]
-  * - alpsteinKey [manyToManyRelation]
-  * - categoryId [input]
-  * - generalSolutionsId [input]
-  * - icon [image]
-  * - localizedfields [localizedfields]
-  * -- name [input]
-  */
- namespace Pimcore\Model\DataObject;
- use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
- use Pimcore\Model\DataObject\PreGetValueHookInterface;
- /**
- * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing getList(array $config = [])
- * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getBySorting($value, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByAlpsteinKey($value, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByCategoryId($value, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByGeneralSolutionsId($value, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByIcon($value, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\AlpsteinCategory\Listing|\Pimcore\Model\DataObject\AlpsteinCategory|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- */
- class AlpsteinCategory extends Concrete
- {
- protected $o_classId = "AlpsteinCategory";
- protected $o_className = "AlpsteinCategory";
- protected $sorting;
- protected $alpsteinKey;
- protected $categoryId;
- protected $generalSolutionsId;
- protected $icon;
- protected $localizedfields;
- /**
- * @param array $values
- * @return \Pimcore\Model\DataObject\AlpsteinCategory
- */
- public static function create($values = array()) {
-     $object = new static();
-     $object->setValues($values);
-     return $object;
- }
- /**
- * Get sorting - Sorting
- * @return float|null
- */
- public function getSorting()
- {
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("sorting");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     $data = $this->sorting;
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Set sorting - Sorting
- * @param float|null $sorting
- * @return \Pimcore\Model\DataObject\AlpsteinCategory
- */
- public function setSorting($sorting)
- {
-     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
-     $fd = $this->getClass()->getFieldDefinition("sorting");
-     $this->sorting = $fd->preSetData($this, $sorting);
-     return $this;
- }
- /**
- * Get alpsteinKey - Alpstein Key
- * @return \Pimcore\Model\DataObject\AlpsteinKey[]
- */
- public function getAlpsteinKey()
- {
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("alpsteinKey");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     $data = $this->getClass()->getFieldDefinition("alpsteinKey")->preGetData($this);
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Set alpsteinKey - Alpstein Key
- * @param \Pimcore\Model\DataObject\AlpsteinKey[] $alpsteinKey
- * @return \Pimcore\Model\DataObject\AlpsteinCategory
- */
- public function setAlpsteinKey($alpsteinKey)
- {
-     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyRelation $fd */
-     $fd = $this->getClass()->getFieldDefinition("alpsteinKey");
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getAlpsteinKey();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     $isEqual = $fd->isEqual($currentData, $alpsteinKey);
-     if (!$isEqual) {
-         $this->markFieldDirty("alpsteinKey", true);
-     }
-     $this->alpsteinKey = $fd->preSetData($this, $alpsteinKey);
-     return $this;
- }
- /**
- * Get categoryId - Category ID
- * @return string|null
- */
- public function getCategoryId()
- {
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("categoryId");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     $data = $this->categoryId;
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Set categoryId - Category ID
- * @param string|null $categoryId
- * @return \Pimcore\Model\DataObject\AlpsteinCategory
- */
- public function setCategoryId($categoryId)
- {
-     $this->categoryId = $categoryId;
-     return $this;
- }
- /**
- * Get generalSolutionsId - General Solutions ID
- * @return string|null
- */
- public function getGeneralSolutionsId()
- {
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("generalSolutionsId");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     $data = $this->generalSolutionsId;
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Set generalSolutionsId - General Solutions ID
- * @param string|null $generalSolutionsId
- * @return \Pimcore\Model\DataObject\AlpsteinCategory
- */
- public function setGeneralSolutionsId($generalSolutionsId)
- {
-     $this->generalSolutionsId = $generalSolutionsId;
-     return $this;
- }
- /**
- * Get icon - Icon
- * @return \Pimcore\Model\Asset\Image|null
- */
- public function getIcon()
- {
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("icon");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     $data = $this->icon;
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Set icon - Icon
- * @param \Pimcore\Model\Asset\Image|null $icon
- * @return \Pimcore\Model\DataObject\AlpsteinCategory
- */
- public function setIcon($icon)
- {
-     $this->icon = $icon;
-     return $this;
- }
- /**
- * Get localizedfields - 
- * @return \Pimcore\Model\DataObject\Localizedfield|null
- */
- public function getLocalizedfields()
- {
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("localizedfields");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     $data = $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get name - Name
- * @return string|null
- */
- public function getName($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("name", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("name");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Set localizedfields - 
- * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
- * @return \Pimcore\Model\DataObject\AlpsteinCategory
- */
- public function setLocalizedfields($localizedfields)
- {
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getLocalizedfields();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     $this->markFieldDirty("localizedfields", true);
-     $this->localizedfields = $localizedfields;
-     return $this;
- }
- /**
- * Set name - Name
- * @param string|null $name
- * @return \Pimcore\Model\DataObject\AlpsteinCategory
- */
- public function setName ($name, $language = null)
- {
-     $isEqual = false;
-     $this->getLocalizedfields()->setLocalizedValue("name", $name, $language, !$isEqual);
-     return $this;
- }
- }
-