<?php
/**
* Inheritance: no
* Variants: no
Fields Summary:
- localizedfields [localizedfields]
-- name [input]
-- main_description [textarea]
-- image [image]
-- resource_banner [image]
-- resource_banner_mobile [image]
-- meta_title [input]
-- meta_description [textarea]
- resources [block]
-- localizedfields [localizedfields]
--- resource_heading [input]
--- description [wysiwyg]
--- resource_image [image]
--- resource_video [video]
- category [manyToOneRelation]
- subcategory [manyToManyObjectRelation]
- related_article [manyToManyObjectRelation]
- mostpopular [booleanSelect]
- url [input]
- references_links [block]
-- references [input]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Resources\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByMain_description($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByImage($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByResource_banner($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByResource_banner_mobile($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByMeta_title($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByMeta_description($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getBySubcategory($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByRelated_article($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Resources\Listing|\Pimcore\Model\DataObject\Resources|null getByUrl($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Resources extends Concrete
{
protected $o_classId = "38";
protected $o_className = "resources";
protected $localizedfields;
protected $resources;
protected $category;
protected $subcategory;
protected $related_article;
protected $mostpopular;
protected $url;
protected $references_links;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Resources
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get localizedfields -
* @return \Pimcore\Model\DataObject\Localizedfield|null
*/
public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
{
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): ?string
{
$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;
}
/**
* Get main_description - Main Description
* @return string|null
*/
public function getMain_description($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("main_description", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("main_description");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get image - image
* @return \Pimcore\Model\Asset\Image|null
*/
public function getImage($language = null): ?\Pimcore\Model\Asset\Image
{
$data = $this->getLocalizedfields()->getLocalizedValue("image", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("image");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get resource_banner - Resource Banner
* @return \Pimcore\Model\Asset\Image|null
*/
public function getResource_banner($language = null): ?\Pimcore\Model\Asset\Image
{
$data = $this->getLocalizedfields()->getLocalizedValue("resource_banner", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("resource_banner");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get resource_banner_mobile - Resource Banner Mobile
* @return \Pimcore\Model\Asset\Image|null
*/
public function getResource_banner_mobile($language = null): ?\Pimcore\Model\Asset\Image
{
$data = $this->getLocalizedfields()->getLocalizedValue("resource_banner_mobile", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("resource_banner_mobile");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get meta_title - meta_title
* @return string|null
*/
public function getMeta_title($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("meta_title", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("meta_title");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get meta_description - Meta Description
* @return string|null
*/
public function getMeta_description($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("meta_description", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("meta_description");
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\Resources
*/
public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $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\Resources
*/
public function setName (?string $name, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("name", $name, $language, !$isEqual);
return $this;
}
/**
* Set main_description - Main Description
* @param string|null $main_description
* @return \Pimcore\Model\DataObject\Resources
*/
public function setMain_description (?string $main_description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("main_description", $main_description, $language, !$isEqual);
return $this;
}
/**
* Set image - image
* @param \Pimcore\Model\Asset\Image|null $image
* @return \Pimcore\Model\DataObject\Resources
*/
public function setImage (?\Pimcore\Model\Asset\Image $image, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("image", $image, $language, !$isEqual);
return $this;
}
/**
* Set resource_banner - Resource Banner
* @param \Pimcore\Model\Asset\Image|null $resource_banner
* @return \Pimcore\Model\DataObject\Resources
*/
public function setResource_banner (?\Pimcore\Model\Asset\Image $resource_banner, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("resource_banner", $resource_banner, $language, !$isEqual);
return $this;
}
/**
* Set resource_banner_mobile - Resource Banner Mobile
* @param \Pimcore\Model\Asset\Image|null $resource_banner_mobile
* @return \Pimcore\Model\DataObject\Resources
*/
public function setResource_banner_mobile (?\Pimcore\Model\Asset\Image $resource_banner_mobile, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("resource_banner_mobile", $resource_banner_mobile, $language, !$isEqual);
return $this;
}
/**
* Set meta_title - meta_title
* @param string|null $meta_title
* @return \Pimcore\Model\DataObject\Resources
*/
public function setMeta_title (?string $meta_title, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("meta_title", $meta_title, $language, !$isEqual);
return $this;
}
/**
* Set meta_description - Meta Description
* @param string|null $meta_description
* @return \Pimcore\Model\DataObject\Resources
*/
public function setMeta_description (?string $meta_description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("meta_description", $meta_description, $language, !$isEqual);
return $this;
}
/**
* Get resources - Resources
* @return \Pimcore\Model\DataObject\Data\BlockElement[][]
*/
public function getResources(): ?array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("resources");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("resources")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set resources - Resources
* @param \Pimcore\Model\DataObject\Data\BlockElement[][] $resources
* @return \Pimcore\Model\DataObject\Resources
*/
public function setResources(?array $resources)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
$fd = $this->getClass()->getFieldDefinition("resources");
$this->resources = $fd->preSetData($this, $resources);
return $this;
}
/**
* Get category - category
* @return \Pimcore\Model\DataObject\Resourcecategory|null
*/
public function getCategory(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("category");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("category")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set category - category
* @param \Pimcore\Model\DataObject\Resourcecategory $category
* @return \Pimcore\Model\DataObject\Resources
*/
public function setCategory(?\Pimcore\Model\Element\AbstractElement $category)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("category");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getCategory();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $category);
if (!$isEqual) {
$this->markFieldDirty("category", true);
}
$this->category = $fd->preSetData($this, $category);
return $this;
}
/**
* Get subcategory - subcategory
* @return \Pimcore\Model\DataObject\Resourcecategory[]
*/
public function getSubcategory(): array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("subcategory");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("subcategory")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set subcategory - subcategory
* @param \Pimcore\Model\DataObject\Resourcecategory[] $subcategory
* @return \Pimcore\Model\DataObject\Resources
*/
public function setSubcategory(?array $subcategory)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("subcategory");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getSubcategory();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $subcategory);
if (!$isEqual) {
$this->markFieldDirty("subcategory", true);
}
$this->subcategory = $fd->preSetData($this, $subcategory);
return $this;
}
/**
* Get related_article - Related Article
* @return \Pimcore\Model\DataObject\Resources[]
*/
public function getRelated_article(): array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("related_article");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("related_article")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set related_article - Related Article
* @param \Pimcore\Model\DataObject\Resources[] $related_article
* @return \Pimcore\Model\DataObject\Resources
*/
public function setRelated_article(?array $related_article)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("related_article");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getRelated_article();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $related_article);
if (!$isEqual) {
$this->markFieldDirty("related_article", true);
}
$this->related_article = $fd->preSetData($this, $related_article);
return $this;
}
/**
* Get mostpopular - Most Popular
* @return bool|null
*/
public function getMostpopular(): ?bool
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("mostpopular");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->mostpopular;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set mostpopular - Most Popular
* @param bool|null $mostpopular
* @return \Pimcore\Model\DataObject\Resources
*/
public function setMostpopular(?bool $mostpopular)
{
$this->mostpopular = $mostpopular;
return $this;
}
/**
* Get url - url
* @return string|null
*/
public function getUrl(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("url");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->url;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set url - url
* @param string|null $url
* @return \Pimcore\Model\DataObject\Resources
*/
public function setUrl(?string $url)
{
$this->url = $url;
return $this;
}
/**
* Get references_links - References Links
* @return \Pimcore\Model\DataObject\Data\BlockElement[][]
*/
public function getReferences_links(): ?array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("references_links");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("references_links")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set references_links - References Links
* @param \Pimcore\Model\DataObject\Data\BlockElement[][] $references_links
* @return \Pimcore\Model\DataObject\Resources
*/
public function setReferences_links(?array $references_links)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
$fd = $this->getClass()->getFieldDefinition("references_links");
$this->references_links = $fd->preSetData($this, $references_links);
return $this;
}
}