var/classes/DataObject/BlogPortal.php line 39

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: yes
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - name [input]
  8.  * - localizedfields [localizedfields]
  9.  * -- overviewDocument [manyToOneRelation]
  10.  * -- archiveDocument [manyToOneRelation]
  11.  * -- authorsDocument [manyToOneRelation]
  12.  * -- searchDocument [manyToOneRelation]
  13.  * -- subscribeConfirmDocument [manyToOneRelation]
  14.  * -- unsubscribeDocument [manyToOneRelation]
  15.  * -- notifyMail [manyToOneRelation]
  16.  * -- subscribeMail [manyToOneRelation]
  17.  */
  18. namespace Pimcore\Model\DataObject;
  19. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  20. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  21. /**
  22. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing getList(array $config = [])
  23. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByOverviewDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  26. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByArchiveDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  27. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByAuthorsDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getBySearchDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getBySubscribeConfirmDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByUnsubscribeDocument($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getByNotifyMail($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  32. * @method static \Pimcore\Model\DataObject\BlogPortal\Listing|\Pimcore\Model\DataObject\BlogPortal|null getBySubscribeMail($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  33. */
  34. class BlogPortal extends Concrete
  35. {
  36. protected $o_classId "BlogPortal";
  37. protected $o_className "BlogPortal";
  38. protected $name;
  39. protected $localizedfields;
  40. /**
  41. * @param array $values
  42. * @return \Pimcore\Model\DataObject\BlogPortal
  43. */
  44. public static function create($values = array()) {
  45.     $object = new static();
  46.     $object->setValues($values);
  47.     return $object;
  48. }
  49. /**
  50. * Get name - Name
  51. * @return string|null
  52. */
  53. public function getName()
  54. {
  55.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  56.         $preValue $this->preGetValue("name");
  57.         if ($preValue !== null) {
  58.             return $preValue;
  59.         }
  60.     }
  61.     $data $this->name;
  62.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("name")->isEmpty($data)) {
  63.         try {
  64.             return $this->getValueFromParent("name");
  65.         } catch (InheritanceParentNotFoundException $e) {
  66.             // no data from parent available, continue ...
  67.         }
  68.     }
  69.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  70.         return $data->getPlain();
  71.     }
  72.     return $data;
  73. }
  74. /**
  75. * Set name - Name
  76. * @param string|null $name
  77. * @return \Pimcore\Model\DataObject\BlogPortal
  78. */
  79. public function setName($name)
  80. {
  81.     $this->name $name;
  82.     return $this;
  83. }
  84. /**
  85. * Get localizedfields - 
  86. * @return \Pimcore\Model\DataObject\Localizedfield|null
  87. */
  88. public function getLocalizedfields()
  89. {
  90.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  91.         $preValue $this->preGetValue("localizedfields");
  92.         if ($preValue !== null) {
  93.             return $preValue;
  94.         }
  95.     }
  96.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  97.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("localizedfields")->isEmpty($data)) {
  98.         try {
  99.             return $this->getValueFromParent("localizedfields");
  100.         } catch (InheritanceParentNotFoundException $e) {
  101.             // no data from parent available, continue ...
  102.         }
  103.     }
  104.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  105.         return $data->getPlain();
  106.     }
  107.     return $data;
  108. }
  109. /**
  110. * Get overviewDocument - Overview Document
  111. * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null
  112. */
  113. public function getOverviewDocument($language null)
  114. {
  115.     $data $this->getLocalizedfields()->getLocalizedValue("overviewDocument"$language);
  116.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  117.         $preValue $this->preGetValue("overviewDocument");
  118.         if ($preValue !== null) {
  119.             return $preValue;
  120.         }
  121.     }
  122.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  123.         return $data->getPlain();
  124.     }
  125.     return $data;
  126. }
  127. /**
  128. * Get archiveDocument - Archive Document
  129. * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null
  130. */
  131. public function getArchiveDocument($language null)
  132. {
  133.     $data $this->getLocalizedfields()->getLocalizedValue("archiveDocument"$language);
  134.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  135.         $preValue $this->preGetValue("archiveDocument");
  136.         if ($preValue !== null) {
  137.             return $preValue;
  138.         }
  139.     }
  140.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  141.         return $data->getPlain();
  142.     }
  143.     return $data;
  144. }
  145. /**
  146. * Get authorsDocument - Authors Document
  147. * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null
  148. */
  149. public function getAuthorsDocument($language null)
  150. {
  151.     $data $this->getLocalizedfields()->getLocalizedValue("authorsDocument"$language);
  152.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  153.         $preValue $this->preGetValue("authorsDocument");
  154.         if ($preValue !== null) {
  155.             return $preValue;
  156.         }
  157.     }
  158.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  159.         return $data->getPlain();
  160.     }
  161.     return $data;
  162. }
  163. /**
  164. * Get searchDocument - Search Document
  165. * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink|null
  166. */
  167. public function getSearchDocument($language null)
  168. {
  169.     $data $this->getLocalizedfields()->getLocalizedValue("searchDocument"$language);
  170.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  171.         $preValue $this->preGetValue("searchDocument");
  172.         if ($preValue !== null) {
  173.             return $preValue;
  174.         }
  175.     }
  176.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  177.         return $data->getPlain();
  178.     }
  179.     return $data;
  180. }
  181. /**
  182. * Get subscribeConfirmDocument - Subscribe Confirm Document
  183. * @return \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Page|null
  184. */
  185. public function getSubscribeConfirmDocument($language null)
  186. {
  187.     $data $this->getLocalizedfields()->getLocalizedValue("subscribeConfirmDocument"$language);
  188.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  189.         $preValue $this->preGetValue("subscribeConfirmDocument");
  190.         if ($preValue !== null) {
  191.             return $preValue;
  192.         }
  193.     }
  194.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  195.         return $data->getPlain();
  196.     }
  197.     return $data;
  198. }
  199. /**
  200. * Get unsubscribeDocument - Unsubscribe Document
  201. * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Link|null
  202. */
  203. public function getUnsubscribeDocument($language null)
  204. {
  205.     $data $this->getLocalizedfields()->getLocalizedValue("unsubscribeDocument"$language);
  206.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  207.         $preValue $this->preGetValue("unsubscribeDocument");
  208.         if ($preValue !== null) {
  209.             return $preValue;
  210.         }
  211.     }
  212.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  213.         return $data->getPlain();
  214.     }
  215.     return $data;
  216. }
  217. /**
  218. * Get notifyMail - Notify Mail
  219. * @return \Pimcore\Model\Document\Email|null
  220. */
  221. public function getNotifyMail($language null)
  222. {
  223.     $data $this->getLocalizedfields()->getLocalizedValue("notifyMail"$language);
  224.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  225.         $preValue $this->preGetValue("notifyMail");
  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. * Get subscribeMail - Subscribe Mail
  237. * @return \Pimcore\Model\Document\Email|null
  238. */
  239. public function getSubscribeMail($language null)
  240. {
  241.     $data $this->getLocalizedfields()->getLocalizedValue("subscribeMail"$language);
  242.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  243.         $preValue $this->preGetValue("subscribeMail");
  244.         if ($preValue !== null) {
  245.             return $preValue;
  246.         }
  247.     }
  248.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  249.         return $data->getPlain();
  250.     }
  251.     return $data;
  252. }
  253. /**
  254. * Set localizedfields - 
  255. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  256. * @return \Pimcore\Model\DataObject\BlogPortal
  257. */
  258. public function setLocalizedfields($localizedfields)
  259. {
  260.     $inheritValues self::getGetInheritedValues();
  261.     self::setGetInheritedValues(false);
  262.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  263.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  264.     $currentData $this->getLocalizedfields();
  265.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  266.     self::setGetInheritedValues($inheritValues);
  267.     $this->markFieldDirty("localizedfields"true);
  268.     $this->localizedfields $localizedfields;
  269.     return $this;
  270. }
  271. /**
  272. * Set overviewDocument - Overview Document
  273. * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink $overviewDocument
  274. * @return \Pimcore\Model\DataObject\BlogPortal
  275. */
  276. public function setOverviewDocument ($overviewDocument$language null)
  277. {
  278.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("overviewDocument");
  279.     $inheritValues self::getGetInheritedValues();
  280.     self::setGetInheritedValues(false);
  281.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  282.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  283.     $currentData $this->getOverviewDocument($language);
  284.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  285.     self::setGetInheritedValues($inheritValues);
  286.     $isEqual $fd->isEqual($currentData$overviewDocument);
  287.     if (!$isEqual) {
  288.         $this->markFieldDirty("overviewDocument"true);
  289.     }
  290.     $this->getLocalizedfields()->setLocalizedValue("overviewDocument"$overviewDocument$language, !$isEqual);
  291.     return $this;
  292. }
  293. /**
  294. * Set archiveDocument - Archive Document
  295. * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink $archiveDocument
  296. * @return \Pimcore\Model\DataObject\BlogPortal
  297. */
  298. public function setArchiveDocument ($archiveDocument$language null)
  299. {
  300.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("archiveDocument");
  301.     $inheritValues self::getGetInheritedValues();
  302.     self::setGetInheritedValues(false);
  303.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  304.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  305.     $currentData $this->getArchiveDocument($language);
  306.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  307.     self::setGetInheritedValues($inheritValues);
  308.     $isEqual $fd->isEqual($currentData$archiveDocument);
  309.     if (!$isEqual) {
  310.         $this->markFieldDirty("archiveDocument"true);
  311.     }
  312.     $this->getLocalizedfields()->setLocalizedValue("archiveDocument"$archiveDocument$language, !$isEqual);
  313.     return $this;
  314. }
  315. /**
  316. * Set authorsDocument - Authors Document
  317. * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink $authorsDocument
  318. * @return \Pimcore\Model\DataObject\BlogPortal
  319. */
  320. public function setAuthorsDocument ($authorsDocument$language null)
  321. {
  322.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("authorsDocument");
  323.     $inheritValues self::getGetInheritedValues();
  324.     self::setGetInheritedValues(false);
  325.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  326.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  327.     $currentData $this->getAuthorsDocument($language);
  328.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  329.     self::setGetInheritedValues($inheritValues);
  330.     $isEqual $fd->isEqual($currentData$authorsDocument);
  331.     if (!$isEqual) {
  332.         $this->markFieldDirty("authorsDocument"true);
  333.     }
  334.     $this->getLocalizedfields()->setLocalizedValue("authorsDocument"$authorsDocument$language, !$isEqual);
  335.     return $this;
  336. }
  337. /**
  338. * Set searchDocument - Search Document
  339. * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink $searchDocument
  340. * @return \Pimcore\Model\DataObject\BlogPortal
  341. */
  342. public function setSearchDocument ($searchDocument$language null)
  343. {
  344.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("searchDocument");
  345.     $inheritValues self::getGetInheritedValues();
  346.     self::setGetInheritedValues(false);
  347.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  348.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  349.     $currentData $this->getSearchDocument($language);
  350.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  351.     self::setGetInheritedValues($inheritValues);
  352.     $isEqual $fd->isEqual($currentData$searchDocument);
  353.     if (!$isEqual) {
  354.         $this->markFieldDirty("searchDocument"true);
  355.     }
  356.     $this->getLocalizedfields()->setLocalizedValue("searchDocument"$searchDocument$language, !$isEqual);
  357.     return $this;
  358. }
  359. /**
  360. * Set subscribeConfirmDocument - Subscribe Confirm Document
  361. * @param \Pimcore\Model\Document\Link | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Page $subscribeConfirmDocument
  362. * @return \Pimcore\Model\DataObject\BlogPortal
  363. */
  364. public function setSubscribeConfirmDocument ($subscribeConfirmDocument$language null)
  365. {
  366.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("subscribeConfirmDocument");
  367.     $inheritValues self::getGetInheritedValues();
  368.     self::setGetInheritedValues(false);
  369.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  370.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  371.     $currentData $this->getSubscribeConfirmDocument($language);
  372.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  373.     self::setGetInheritedValues($inheritValues);
  374.     $isEqual $fd->isEqual($currentData$subscribeConfirmDocument);
  375.     if (!$isEqual) {
  376.         $this->markFieldDirty("subscribeConfirmDocument"true);
  377.     }
  378.     $this->getLocalizedfields()->setLocalizedValue("subscribeConfirmDocument"$subscribeConfirmDocument$language, !$isEqual);
  379.     return $this;
  380. }
  381. /**
  382. * Set unsubscribeDocument - Unsubscribe Document
  383. * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Link $unsubscribeDocument
  384. * @return \Pimcore\Model\DataObject\BlogPortal
  385. */
  386. public function setUnsubscribeDocument ($unsubscribeDocument$language null)
  387. {
  388.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("unsubscribeDocument");
  389.     $inheritValues self::getGetInheritedValues();
  390.     self::setGetInheritedValues(false);
  391.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  392.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  393.     $currentData $this->getUnsubscribeDocument($language);
  394.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  395.     self::setGetInheritedValues($inheritValues);
  396.     $isEqual $fd->isEqual($currentData$unsubscribeDocument);
  397.     if (!$isEqual) {
  398.         $this->markFieldDirty("unsubscribeDocument"true);
  399.     }
  400.     $this->getLocalizedfields()->setLocalizedValue("unsubscribeDocument"$unsubscribeDocument$language, !$isEqual);
  401.     return $this;
  402. }
  403. /**
  404. * Set notifyMail - Notify Mail
  405. * @param \Pimcore\Model\Document\Email $notifyMail
  406. * @return \Pimcore\Model\DataObject\BlogPortal
  407. */
  408. public function setNotifyMail ($notifyMail$language null)
  409. {
  410.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("notifyMail");
  411.     $inheritValues self::getGetInheritedValues();
  412.     self::setGetInheritedValues(false);
  413.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  414.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  415.     $currentData $this->getNotifyMail($language);
  416.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  417.     self::setGetInheritedValues($inheritValues);
  418.     $isEqual $fd->isEqual($currentData$notifyMail);
  419.     if (!$isEqual) {
  420.         $this->markFieldDirty("notifyMail"true);
  421.     }
  422.     $this->getLocalizedfields()->setLocalizedValue("notifyMail"$notifyMail$language, !$isEqual);
  423.     return $this;
  424. }
  425. /**
  426. * Set subscribeMail - Subscribe Mail
  427. * @param \Pimcore\Model\Document\Email $subscribeMail
  428. * @return \Pimcore\Model\DataObject\BlogPortal
  429. */
  430. public function setSubscribeMail ($subscribeMail$language null)
  431. {
  432.     $fd $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("subscribeMail");
  433.     $inheritValues self::getGetInheritedValues();
  434.     self::setGetInheritedValues(false);
  435.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  436.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  437.     $currentData $this->getSubscribeMail($language);
  438.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  439.     self::setGetInheritedValues($inheritValues);
  440.     $isEqual $fd->isEqual($currentData$subscribeMail);
  441.     if (!$isEqual) {
  442.         $this->markFieldDirty("subscribeMail"true);
  443.     }
  444.     $this->getLocalizedfields()->setLocalizedValue("subscribeMail"$subscribeMail$language, !$isEqual);
  445.     return $this;
  446. }
  447. }