- <?php
- /**
-  * Inheritance: yes
-  * Variants: no
-  *
-  * Fields Summary:
-  * - name [input]
-  * - localizedfields [localizedfields]
-  * -- overviewDocument [manyToOneRelation]
-  * -- archiveDocument [manyToOneRelation]
-  * -- authorsDocument [manyToOneRelation]
-  * -- searchDocument [manyToOneRelation]
-  * -- subscribeConfirmDocument [manyToOneRelation]
-  * -- unsubscribeDocument [manyToOneRelation]
-  * -- notifyMail [manyToOneRelation]
-  * -- subscribeMail [manyToOneRelation]
-  */
- namespace Pimcore\Model\DataObject;
- use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
- use Pimcore\Model\DataObject\PreGetValueHookInterface;
- /**
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing getList(array $config = [])
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByOverviewDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByArchiveDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByAuthorsDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getBySearchDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getBySubscribeConfirmDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByUnsubscribeDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByNotifyMail($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getBySubscribeMail($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
- */
- class BlogPortal extends Concrete
- {
- protected $o_classId = "BlogPortal";
- protected $o_className = "BlogPortal";
- protected $name;
- protected $localizedfields;
- /**
- * @param array $values
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public static function create($values = array()) {
-     $object = new static();
-     $object->setValues($values);
-     return $object;
- }
- /**
- * Get name - Name
- * @return string|null
- */
- public function getName()
- {
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("name");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     $data = $this->name;
-     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("name")->isEmpty($data)) {
-         try {
-             return $this->getValueFromParent("name");
-         } catch (InheritanceParentNotFoundException $e) {
-             // no data from parent available, continue ...
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Set name - Name
- * @param string|null $name
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setName($name)
- {
-     $this->name = $name;
-     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 (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("localizedfields")->isEmpty($data)) {
-         try {
-             return $this->getValueFromParent("localizedfields");
-         } catch (InheritanceParentNotFoundException $e) {
-             // no data from parent available, continue ...
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get overviewDocument - Overview Document
- * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null
- */
- public function getOverviewDocument($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("overviewDocument", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("overviewDocument");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get archiveDocument - Archive Document
- * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null
- */
- public function getArchiveDocument($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("archiveDocument", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("archiveDocument");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get authorsDocument - Authors Document
- * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null
- */
- public function getAuthorsDocument($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("authorsDocument", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("authorsDocument");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get searchDocument - Search Document
- * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null
- */
- public function getSearchDocument($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("searchDocument", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("searchDocument");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get subscribeConfirmDocument - Subscribe Confirm Document
- * @return \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Page|null
- */
- public function getSubscribeConfirmDocument($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("subscribeConfirmDocument", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("subscribeConfirmDocument");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get unsubscribeDocument - Unsubscribe Document
- * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Link|null
- */
- public function getUnsubscribeDocument($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("unsubscribeDocument", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("unsubscribeDocument");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get notifyMail - Notify Mail
- * @return \Pimcore\Model\Document\Email|null
- */
- public function getNotifyMail($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("notifyMail", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("notifyMail");
-         if ($preValue !== null) {
-             return $preValue;
-         }
-     }
-     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
-         return $data->getPlain();
-     }
-     return $data;
- }
- /**
- * Get subscribeMail - Subscribe Mail
- * @return \Pimcore\Model\Document\Email|null
- */
- public function getSubscribeMail($language = null)
- {
-     $data = $this->getLocalizedfields()->getLocalizedValue("subscribeMail", $language);
-     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
-         $preValue = $this->preGetValue("subscribeMail");
-         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\BlogPortal
- */
- public function setLocalizedfields($localizedfields)
- {
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getLocalizedfields();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $this->markFieldDirty("localizedfields", true);
-     $this->localizedfields = $localizedfields;
-     return $this;
- }
- /**
- * Set overviewDocument - Overview Document
- * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null $overviewDocument
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setOverviewDocument ($overviewDocument, $language = null)
- {
-     $fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("overviewDocument");
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getOverviewDocument($language);
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $isEqual = $fd->isEqual($currentData, $overviewDocument);
-     if (!$isEqual) {
-         $this->markFieldDirty("overviewDocument", true);
-     }
-     $this->getLocalizedfields()->setLocalizedValue("overviewDocument", $overviewDocument, $language, !$isEqual);
-     return $this;
- }
- /**
- * Set archiveDocument - Archive Document
- * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null $archiveDocument
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setArchiveDocument ($archiveDocument, $language = null)
- {
-     $fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("archiveDocument");
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getArchiveDocument($language);
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $isEqual = $fd->isEqual($currentData, $archiveDocument);
-     if (!$isEqual) {
-         $this->markFieldDirty("archiveDocument", true);
-     }
-     $this->getLocalizedfields()->setLocalizedValue("archiveDocument", $archiveDocument, $language, !$isEqual);
-     return $this;
- }
- /**
- * Set authorsDocument - Authors Document
- * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null $authorsDocument
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setAuthorsDocument ($authorsDocument, $language = null)
- {
-     $fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("authorsDocument");
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getAuthorsDocument($language);
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $isEqual = $fd->isEqual($currentData, $authorsDocument);
-     if (!$isEqual) {
-         $this->markFieldDirty("authorsDocument", true);
-     }
-     $this->getLocalizedfields()->setLocalizedValue("authorsDocument", $authorsDocument, $language, !$isEqual);
-     return $this;
- }
- /**
- * Set searchDocument - Search Document
- * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null $searchDocument
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setSearchDocument ($searchDocument, $language = null)
- {
-     $fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("searchDocument");
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getSearchDocument($language);
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $isEqual = $fd->isEqual($currentData, $searchDocument);
-     if (!$isEqual) {
-         $this->markFieldDirty("searchDocument", true);
-     }
-     $this->getLocalizedfields()->setLocalizedValue("searchDocument", $searchDocument, $language, !$isEqual);
-     return $this;
- }
- /**
- * Set subscribeConfirmDocument - Subscribe Confirm Document
- * @param \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Page|null $subscribeConfirmDocument
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setSubscribeConfirmDocument ($subscribeConfirmDocument, $language = null)
- {
-     $fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("subscribeConfirmDocument");
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getSubscribeConfirmDocument($language);
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $isEqual = $fd->isEqual($currentData, $subscribeConfirmDocument);
-     if (!$isEqual) {
-         $this->markFieldDirty("subscribeConfirmDocument", true);
-     }
-     $this->getLocalizedfields()->setLocalizedValue("subscribeConfirmDocument", $subscribeConfirmDocument, $language, !$isEqual);
-     return $this;
- }
- /**
- * Set unsubscribeDocument - Unsubscribe Document
- * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Link|null $unsubscribeDocument
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setUnsubscribeDocument ($unsubscribeDocument, $language = null)
- {
-     $fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("unsubscribeDocument");
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getUnsubscribeDocument($language);
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $isEqual = $fd->isEqual($currentData, $unsubscribeDocument);
-     if (!$isEqual) {
-         $this->markFieldDirty("unsubscribeDocument", true);
-     }
-     $this->getLocalizedfields()->setLocalizedValue("unsubscribeDocument", $unsubscribeDocument, $language, !$isEqual);
-     return $this;
- }
- /**
- * Set notifyMail - Notify Mail
- * @param \Pimcore\Model\Document\Email|null $notifyMail
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setNotifyMail ($notifyMail, $language = null)
- {
-     $fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("notifyMail");
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getNotifyMail($language);
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $isEqual = $fd->isEqual($currentData, $notifyMail);
-     if (!$isEqual) {
-         $this->markFieldDirty("notifyMail", true);
-     }
-     $this->getLocalizedfields()->setLocalizedValue("notifyMail", $notifyMail, $language, !$isEqual);
-     return $this;
- }
- /**
- * Set subscribeMail - Subscribe Mail
- * @param \Pimcore\Model\Document\Email|null $subscribeMail
- * @return \Pimcore\Model\DataObject\BlogPortal
- */
- public function setSubscribeMail ($subscribeMail, $language = null)
- {
-     $fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("subscribeMail");
-     $inheritValues = self::getGetInheritedValues();
-     self::setGetInheritedValues(false);
-     $hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
-     $currentData = $this->getSubscribeMail($language);
-     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
-     self::setGetInheritedValues($inheritValues);
-     $isEqual = $fd->isEqual($currentData, $subscribeMail);
-     if (!$isEqual) {
-         $this->markFieldDirty("subscribeMail", true);
-     }
-     $this->getLocalizedfields()->setLocalizedValue("subscribeMail", $subscribeMail, $language, !$isEqual);
-     return $this;
- }
- }
-