<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - localizedfields [localizedfields]
* -- title [input]
* -- additionalText [input]
* -- description [wysiwyg]
* -- displayTitle [input]
* -- relation [manyToOneRelation]
* -- teaserDescription [wysiwyg]
* -- countryRelations [block]
* --- config [manyToOneRelation]
* --- countryRelation [manyToOneRelation]
* --- countryTeaserDescription [wysiwyg]
* - objectBrick [select]
* - contactPersons [manyToManyObjectRelation]
* - image [image]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByAdditionalText($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByDisplayTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByRelation($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByTeaserDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByCountryRelations($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByObjectBrick($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByContactPersons($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\ProductCategory\Listing|\Pimcore\Model\DataObject\ProductCategory|null getByImage($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class ProductCategory extends Concrete
{
protected $o_classId = "ProductCategory";
protected $o_className = "ProductCategory";
protected $localizedfields;
protected $objectBrick;
protected $contactPersons;
protected $image;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\ProductCategory
*/
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 title - Title
* @return string|null
*/
public function getTitle($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("title", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("title");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get additionalText - Additional Text
* @return string|null
*/
public function getAdditionalText($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("additionalText", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("additionalText");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get description - Description
* @return string|null
*/
public function getDescription($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("description", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("description");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get displayTitle - Display Title
* @return string|null
*/
public function getDisplayTitle($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("displayTitle", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("displayTitle");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get relation - Relation
* @return \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Link|null
*/
public function getRelation($language = null): ?\Pimcore\Model\Element\AbstractElement
{
$data = $this->getLocalizedfields()->getLocalizedValue("relation", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("relation");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get teaserDescription - Teaser Description
* @return string|null
*/
public function getTeaserDescription($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("teaserDescription", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("teaserDescription");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get countryRelations - Country Relations
* @return \Pimcore\Model\DataObject\Data\BlockElement[][]
*/
public function getCountryRelations($language = null): ?array
{
$data = $this->getLocalizedfields()->getLocalizedValue("countryRelations", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("countryRelations");
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\ProductCategory
*/
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 title - Title
* @param string|null $title
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setTitle (?string $title, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("title", $title, $language, !$isEqual);
return $this;
}
/**
* Set additionalText - Additional Text
* @param string|null $additionalText
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setAdditionalText (?string $additionalText, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("additionalText", $additionalText, $language, !$isEqual);
return $this;
}
/**
* Set description - Description
* @param string|null $description
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setDescription (?string $description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("description", $description, $language, !$isEqual);
return $this;
}
/**
* Set displayTitle - Display Title
* @param string|null $displayTitle
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setDisplayTitle (?string $displayTitle, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("displayTitle", $displayTitle, $language, !$isEqual);
return $this;
}
/**
* Set relation - Relation
* @param \Pimcore\Model\Document\Page | \Pimcore\Model\Document\Hardlink | \Pimcore\Model\Document\Link|null $relation
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setRelation (?\Pimcore\Model\Element\AbstractElement $relation, $language = null)
{
$fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("relation");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getRelation($language);
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $relation);
if (!$isEqual) {
$this->markFieldDirty("relation", true);
}
$this->getLocalizedfields()->setLocalizedValue("relation", $relation, $language, !$isEqual);
return $this;
}
/**
* Set teaserDescription - Teaser Description
* @param string|null $teaserDescription
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setTeaserDescription (?string $teaserDescription, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("teaserDescription", $teaserDescription, $language, !$isEqual);
return $this;
}
/**
* Set countryRelations - Country Relations
* @param \Pimcore\Model\DataObject\Data\BlockElement[][] $countryRelations
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setCountryRelations (?array $countryRelations, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("countryRelations", $countryRelations, $language, !$isEqual);
return $this;
}
/**
* Get objectBrick - ObjectBrick
* @return string|null
*/
public function getObjectBrick(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("objectBrick");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->objectBrick;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set objectBrick - ObjectBrick
* @param string|null $objectBrick
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setObjectBrick(?string $objectBrick)
{
$this->objectBrick = $objectBrick;
return $this;
}
/**
* Get contactPersons - Contact persons
* @return \Pimcore\Model\DataObject\Contact[]
*/
public function getContactPersons(): array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("contactPersons");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("contactPersons")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set contactPersons - Contact persons
* @param \Pimcore\Model\DataObject\Contact[] $contactPersons
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setContactPersons(?array $contactPersons)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("contactPersons");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getContactPersons();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $contactPersons);
if (!$isEqual) {
$this->markFieldDirty("contactPersons", true);
}
$this->contactPersons = $fd->preSetData($this, $contactPersons);
return $this;
}
/**
* Get image - Image
* @return \Pimcore\Model\Asset\Image|null
*/
public function getImage(): ?\Pimcore\Model\Asset\Image
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("image");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->image;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set image - Image
* @param \Pimcore\Model\Asset\Image|null $image
* @return \Pimcore\Model\DataObject\ProductCategory
*/
public function setImage(?\Pimcore\Model\Asset\Image $image)
{
$this->image = $image;
return $this;
}
}