<?php
/**
* Inheritance: no
* Variants: no
Fields Summary:
- title [input]
- subtitle [input]
- categoriesRoot [manyToOneRelation]
- articlesRoot [manyToOneRelation]
- documentRootDe [manyToOneRelation]
- documentRootEn [manyToOneRelation]
- blogPathPrefix [input]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Blog\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getBySubtitle($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByCategoriesRoot($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByArticlesRoot($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByDocumentRootDe($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByDocumentRootEn($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Blog\Listing|\Pimcore\Model\DataObject\Blog|null getByBlogPathPrefix($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Blog extends Concrete
{
protected $o_classId = "2";
protected $o_className = "Blog";
protected $title;
protected $subtitle;
protected $categoriesRoot;
protected $articlesRoot;
protected $documentRootDe;
protected $documentRootEn;
protected $blogPathPrefix;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Blog
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get title - Blog Titel
* @return string|null
*/
public function getTitle(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("title");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->title;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set title - Blog Titel
* @param string|null $title
* @return \Pimcore\Model\DataObject\Blog
*/
public function setTitle(?string $title)
{
$this->title = $title;
return $this;
}
/**
* Get subtitle - Blog Untertitel
* @return string|null
*/
public function getSubtitle(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("subtitle");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->subtitle;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set subtitle - Blog Untertitel
* @param string|null $subtitle
* @return \Pimcore\Model\DataObject\Blog
*/
public function setSubtitle(?string $subtitle)
{
$this->subtitle = $subtitle;
return $this;
}
/**
* Get categoriesRoot - Kategorien Hauptverzeichnis
* @return \Pimcore\Model\DataObject\BlogCategory | \Pimcore\Model\DataObject\Folder|null
*/
public function getCategoriesRoot(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("categoriesRoot");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("categoriesRoot")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set categoriesRoot - Kategorien Hauptverzeichnis
* @param \Pimcore\Model\DataObject\BlogCategory | \Pimcore\Model\DataObject\Folder $categoriesRoot
* @return \Pimcore\Model\DataObject\Blog
*/
public function setCategoriesRoot(?\Pimcore\Model\Element\AbstractElement $categoriesRoot)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("categoriesRoot");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getCategoriesRoot();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $categoriesRoot);
if (!$isEqual) {
$this->markFieldDirty("categoriesRoot", true);
}
$this->categoriesRoot = $fd->preSetData($this, $categoriesRoot);
return $this;
}
/**
* Get articlesRoot - Artikel Hauptverzeichnis
* @return \Pimcore\Model\DataObject\Folder | \Pimcore\Model\DataObject\BlogArticle|null
*/
public function getArticlesRoot(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("articlesRoot");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("articlesRoot")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set articlesRoot - Artikel Hauptverzeichnis
* @param \Pimcore\Model\DataObject\Folder | \Pimcore\Model\DataObject\BlogArticle $articlesRoot
* @return \Pimcore\Model\DataObject\Blog
*/
public function setArticlesRoot(?\Pimcore\Model\Element\AbstractElement $articlesRoot)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("articlesRoot");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getArticlesRoot();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $articlesRoot);
if (!$isEqual) {
$this->markFieldDirty("articlesRoot", true);
}
$this->articlesRoot = $fd->preSetData($this, $articlesRoot);
return $this;
}
/**
* Get documentRootDe - Dokumenten-Root DE
* @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document|null
*/
public function getDocumentRootDe(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("documentRootDe");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("documentRootDe")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set documentRootDe - Dokumenten-Root DE
* @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document $documentRootDe
* @return \Pimcore\Model\DataObject\Blog
*/
public function setDocumentRootDe(?\Pimcore\Model\Element\AbstractElement $documentRootDe)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("documentRootDe");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getDocumentRootDe();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $documentRootDe);
if (!$isEqual) {
$this->markFieldDirty("documentRootDe", true);
}
$this->documentRootDe = $fd->preSetData($this, $documentRootDe);
return $this;
}
/**
* Get documentRootEn - Dokumenten-Root EN
* @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document|null
*/
public function getDocumentRootEn(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("documentRootEn");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("documentRootEn")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set documentRootEn - Dokumenten-Root EN
* @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Snippet | \Pimcore\Model\Document $documentRootEn
* @return \Pimcore\Model\DataObject\Blog
*/
public function setDocumentRootEn(?\Pimcore\Model\Element\AbstractElement $documentRootEn)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("documentRootEn");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getDocumentRootEn();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $documentRootEn);
if (!$isEqual) {
$this->markFieldDirty("documentRootEn", true);
}
$this->documentRootEn = $fd->preSetData($this, $documentRootEn);
return $this;
}
/**
* Get blogPathPrefix - Blog Pfad-Präfix (z.B. /blog)
* @return string|null
*/
public function getBlogPathPrefix(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("blogPathPrefix");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->blogPathPrefix;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set blogPathPrefix - Blog Pfad-Präfix (z.B. /blog)
* @param string|null $blogPathPrefix
* @return \Pimcore\Model\DataObject\Blog
*/
public function setBlogPathPrefix(?string $blogPathPrefix)
{
$this->blogPathPrefix = $blogPathPrefix;
return $this;
}
}