var/classes/DataObject/Blog.php line 129

Open in your IDE?
  1. <?php
  2. /**
  3. * Inheritance: no
  4. * Variants: no
  5. Fields Summary:
  6. - title [input]
  7. - subtitle [input]
  8. - categoriesRoot [manyToOneRelation]
  9. - articlesRoot [manyToOneRelation]
  10. - documentRootDe [manyToOneRelation]
  11. - documentRootEn [manyToOneRelation]
  12. - blogPathPrefix [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\Blog\Listing getList(array $config = [])
  19. * @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getBySubtitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. * @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByCategoriesRoot($value, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByArticlesRoot($value, $limit = 0, $offset = 0, $objectTypes = null)
  23. * @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByDocumentRootDe($value, $limit = 0, $offset = 0, $objectTypes = null)
  24. * @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByDocumentRootEn($value, $limit = 0, $offset = 0, $objectTypes = null)
  25. * @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByBlogPathPrefix($value, $limit = 0, $offset = 0, $objectTypes = null)
  26. */
  27. class Blog extends Concrete
  28. {
  29. protected $o_classId "2";
  30. protected $o_className "Blog";
  31. protected $title;
  32. protected $subtitle;
  33. protected $categoriesRoot;
  34. protected $articlesRoot;
  35. protected $documentRootDe;
  36. protected $documentRootEn;
  37. protected $blogPathPrefix;
  38. /**
  39. * @param array $values
  40. * @return \Pimcore\Model\DataObject\Blog
  41. */
  42. public static function create($values = array()) {
  43.     $object = new static();
  44.     $object->setValues($values);
  45.     return $object;
  46. }
  47. /**
  48. * Get title - Blog Titel
  49. * @return string|null
  50. */
  51. public function getTitle(): ?string
  52. {
  53.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  54.         $preValue $this->preGetValue("title");
  55.         if ($preValue !== null) {
  56.             return $preValue;
  57.         }
  58.     }
  59.     $data $this->title;
  60.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  61.         return $data->getPlain();
  62.     }
  63.     return $data;
  64. }
  65. /**
  66. * Set title - Blog Titel
  67. * @param string|null $title
  68. * @return \Pimcore\Model\DataObject\Blog
  69. */
  70. public function setTitle(?string $title)
  71. {
  72.     $this->title $title;
  73.     return $this;
  74. }
  75. /**
  76. * Get subtitle - Blog Untertitel
  77. * @return string|null
  78. */
  79. public function getSubtitle(): ?string
  80. {
  81.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  82.         $preValue $this->preGetValue("subtitle");
  83.         if ($preValue !== null) {
  84.             return $preValue;
  85.         }
  86.     }
  87.     $data $this->subtitle;
  88.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  89.         return $data->getPlain();
  90.     }
  91.     return $data;
  92. }
  93. /**
  94. * Set subtitle - Blog Untertitel
  95. * @param string|null $subtitle
  96. * @return \Pimcore\Model\DataObject\Blog
  97. */
  98. public function setSubtitle(?string $subtitle)
  99. {
  100.     $this->subtitle $subtitle;
  101.     return $this;
  102. }
  103. /**
  104. * Get categoriesRoot - Kategorien Hauptverzeichnis
  105. * @return \Pimcore\Model\DataObject\BlogCategory | \Pimcore\Model\DataObject\Folder|null
  106. */
  107. public function getCategoriesRoot(): ?\Pimcore\Model\Element\AbstractElement
  108. {
  109.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  110.         $preValue $this->preGetValue("categoriesRoot");
  111.         if ($preValue !== null) {
  112.             return $preValue;
  113.         }
  114.     }
  115.     $data $this->getClass()->getFieldDefinition("categoriesRoot")->preGetData($this);
  116.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  117.         return $data->getPlain();
  118.     }
  119.     return $data;
  120. }
  121. /**
  122. * Set categoriesRoot - Kategorien Hauptverzeichnis
  123. * @param \Pimcore\Model\DataObject\BlogCategory | \Pimcore\Model\DataObject\Folder $categoriesRoot
  124. * @return \Pimcore\Model\DataObject\Blog
  125. */
  126. public function setCategoriesRoot(?\Pimcore\Model\Element\AbstractElement $categoriesRoot)
  127. {
  128.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  129.     $fd $this->getClass()->getFieldDefinition("categoriesRoot");
  130.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  131.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  132.     $currentData $this->getCategoriesRoot();
  133.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  134.     $isEqual $fd->isEqual($currentData$categoriesRoot);
  135.     if (!$isEqual) {
  136.         $this->markFieldDirty("categoriesRoot"true);
  137.     }
  138.     $this->categoriesRoot $fd->preSetData($this$categoriesRoot);
  139.     return $this;
  140. }
  141. /**
  142. * Get articlesRoot - Artikel Hauptverzeichnis
  143. * @return \Pimcore\Model\DataObject\Folder | \Pimcore\Model\DataObject\BlogArticle|null
  144. */
  145. public function getArticlesRoot(): ?\Pimcore\Model\Element\AbstractElement
  146. {
  147.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  148.         $preValue $this->preGetValue("articlesRoot");
  149.         if ($preValue !== null) {
  150.             return $preValue;
  151.         }
  152.     }
  153.     $data $this->getClass()->getFieldDefinition("articlesRoot")->preGetData($this);
  154.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  155.         return $data->getPlain();
  156.     }
  157.     return $data;
  158. }
  159. /**
  160. * Set articlesRoot - Artikel Hauptverzeichnis
  161. * @param \Pimcore\Model\DataObject\Folder | \Pimcore\Model\DataObject\BlogArticle $articlesRoot
  162. * @return \Pimcore\Model\DataObject\Blog
  163. */
  164. public function setArticlesRoot(?\Pimcore\Model\Element\AbstractElement $articlesRoot)
  165. {
  166.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  167.     $fd $this->getClass()->getFieldDefinition("articlesRoot");
  168.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  169.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  170.     $currentData $this->getArticlesRoot();
  171.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  172.     $isEqual $fd->isEqual($currentData$articlesRoot);
  173.     if (!$isEqual) {
  174.         $this->markFieldDirty("articlesRoot"true);
  175.     }
  176.     $this->articlesRoot $fd->preSetData($this$articlesRoot);
  177.     return $this;
  178. }
  179. /**
  180. * Get documentRootDe - Dokumenten-Root DE
  181. * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document|null
  182. */
  183. public function getDocumentRootDe(): ?\Pimcore\Model\Element\AbstractElement
  184. {
  185.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  186.         $preValue $this->preGetValue("documentRootDe");
  187.         if ($preValue !== null) {
  188.             return $preValue;
  189.         }
  190.     }
  191.     $data $this->getClass()->getFieldDefinition("documentRootDe")->preGetData($this);
  192.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  193.         return $data->getPlain();
  194.     }
  195.     return $data;
  196. }
  197. /**
  198. * Set documentRootDe - Dokumenten-Root DE
  199. * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document $documentRootDe
  200. * @return \Pimcore\Model\DataObject\Blog
  201. */
  202. public function setDocumentRootDe(?\Pimcore\Model\Element\AbstractElement $documentRootDe)
  203. {
  204.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  205.     $fd $this->getClass()->getFieldDefinition("documentRootDe");
  206.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  207.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  208.     $currentData $this->getDocumentRootDe();
  209.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  210.     $isEqual $fd->isEqual($currentData$documentRootDe);
  211.     if (!$isEqual) {
  212.         $this->markFieldDirty("documentRootDe"true);
  213.     }
  214.     $this->documentRootDe $fd->preSetData($this$documentRootDe);
  215.     return $this;
  216. }
  217. /**
  218. * Get documentRootEn - Dokumenten-Root EN
  219. * @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document|null
  220. */
  221. public function getDocumentRootEn(): ?\Pimcore\Model\Element\AbstractElement
  222. {
  223.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  224.         $preValue $this->preGetValue("documentRootEn");
  225.         if ($preValue !== null) {
  226.             return $preValue;
  227.         }
  228.     }
  229.     $data $this->getClass()->getFieldDefinition("documentRootEn")->preGetData($this);
  230.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  231.         return $data->getPlain();
  232.     }
  233.     return $data;
  234. }
  235. /**
  236. * Set documentRootEn - Dokumenten-Root EN
  237. * @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document $documentRootEn
  238. * @return \Pimcore\Model\DataObject\Blog
  239. */
  240. public function setDocumentRootEn(?\Pimcore\Model\Element\AbstractElement $documentRootEn)
  241. {
  242.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  243.     $fd $this->getClass()->getFieldDefinition("documentRootEn");
  244.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  245.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  246.     $currentData $this->getDocumentRootEn();
  247.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  248.     $isEqual $fd->isEqual($currentData$documentRootEn);
  249.     if (!$isEqual) {
  250.         $this->markFieldDirty("documentRootEn"true);
  251.     }
  252.     $this->documentRootEn $fd->preSetData($this$documentRootEn);
  253.     return $this;
  254. }
  255. /**
  256. * Get blogPathPrefix - Blog Pfad-Präfix (z.B. /blog)
  257. * @return string|null
  258. */
  259. public function getBlogPathPrefix(): ?string
  260. {
  261.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  262.         $preValue $this->preGetValue("blogPathPrefix");
  263.         if ($preValue !== null) {
  264.             return $preValue;
  265.         }
  266.     }
  267.     $data $this->blogPathPrefix;
  268.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  269.         return $data->getPlain();
  270.     }
  271.     return $data;
  272. }
  273. /**
  274. * Set blogPathPrefix - Blog Pfad-Präfix (z.B. /blog)
  275. * @param string|null $blogPathPrefix
  276. * @return \Pimcore\Model\DataObject\Blog
  277. */
  278. public function setBlogPathPrefix(?string $blogPathPrefix)
  279. {
  280.     $this->blogPathPrefix $blogPathPrefix;
  281.     return $this;
  282. }
  283. }