<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - URL [input]
* - localizedfields [localizedfields]
* -- name [input]
* -- description [textarea]
* -- slug [urlSlug]
* -- mobileMenuImage [image]
* -- mobileCoverImage [image]
* -- pimcoreMetaTitle [input]
* -- pimcoreMetaDescription [textarea]
* - filter [coreShopFilter]
* - stores [coreShopStoreMultiselect]
* - parentCategory [coreShopRelation]
* - workingName [input]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByURL($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getBySlug($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByMobileMenuImage($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByMobileCoverImage($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByPimcoreMetaTitle($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByPimcoreMetaDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByStores($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByParentCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\CoreShopCategory\Listing|\Pimcore\Model\DataObject\CoreShopCategory|null getByWorkingName($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class CoreShopCategory extends \CoreShop\Component\Core\Model\Category
{
protected $o_classId = "cs_category";
protected $o_className = "CoreShopCategory";
protected $URL;
protected $localizedfields;
protected $filter;
protected $stores;
protected $parentCategory;
protected $workingName;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* 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\CoreShopCategory
*/
public function setURL(?string $URL)
{
$this->URL = $URL;
return $this;
}
/**
* 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 - coreshop.category.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 description - coreshop.category.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 slug - coreshop.category.slug
* @return \Pimcore\Model\DataObject\Data\UrlSlug[]
*/
public function getSlug($language = null): ?array
{
$data = $this->getLocalizedfields()->getLocalizedValue("slug", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("slug");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get mobileMenuImage - Mobile Menu Image
* @return \Pimcore\Model\Asset\Image|null
*/
public function getMobileMenuImage($language = null): ?\Pimcore\Model\Asset\Image
{
$data = $this->getLocalizedfields()->getLocalizedValue("mobileMenuImage", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("mobileMenuImage");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get mobileCoverImage - Mobile Cover Image
* @return \Pimcore\Model\Asset\Image|null
*/
public function getMobileCoverImage($language = null): ?\Pimcore\Model\Asset\Image
{
$data = $this->getLocalizedfields()->getLocalizedValue("mobileCoverImage", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("mobileCoverImage");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get pimcoreMetaTitle - coreshop.category.seo_meta_title
* @return string|null
*/
public function getPimcoreMetaTitle($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("pimcoreMetaTitle", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("pimcoreMetaTitle");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get pimcoreMetaDescription - coreshop.category.seo_meta_description
* @return string|null
*/
public function getPimcoreMetaDescription($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("pimcoreMetaDescription", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("pimcoreMetaDescription");
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\CoreShopCategory
*/
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 - coreshop.category.name
* @param string|null $name
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setName (?string $name, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("name", $name, $language, !$isEqual);
return $this;
}
/**
* Set description - coreshop.category.description
* @param string|null $description
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setDescription (?string $description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("description", $description, $language, !$isEqual);
return $this;
}
/**
* Set slug - coreshop.category.slug
* @param \Pimcore\Model\DataObject\Data\UrlSlug[] $slug
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setSlug (?array $slug, $language = null)
{
$fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("slug");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getSlug($language);
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $slug);
if (!$isEqual) {
$this->markFieldDirty("slug", true);
}
$this->getLocalizedfields()->setLocalizedValue("slug", $slug, $language, !$isEqual);
return $this;
}
/**
* Set mobileMenuImage - Mobile Menu Image
* @param \Pimcore\Model\Asset\Image|null $mobileMenuImage
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setMobileMenuImage (?\Pimcore\Model\Asset\Image $mobileMenuImage, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("mobileMenuImage", $mobileMenuImage, $language, !$isEqual);
return $this;
}
/**
* Set mobileCoverImage - Mobile Cover Image
* @param \Pimcore\Model\Asset\Image|null $mobileCoverImage
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setMobileCoverImage (?\Pimcore\Model\Asset\Image $mobileCoverImage, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("mobileCoverImage", $mobileCoverImage, $language, !$isEqual);
return $this;
}
/**
* Set pimcoreMetaTitle - coreshop.category.seo_meta_title
* @param string|null $pimcoreMetaTitle
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setPimcoreMetaTitle (?string $pimcoreMetaTitle, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("pimcoreMetaTitle", $pimcoreMetaTitle, $language, !$isEqual);
return $this;
}
/**
* Set pimcoreMetaDescription - coreshop.category.seo_meta_description
* @param string|null $pimcoreMetaDescription
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setPimcoreMetaDescription (?string $pimcoreMetaDescription, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("pimcoreMetaDescription", $pimcoreMetaDescription, $language, !$isEqual);
return $this;
}
/**
* Get filter - coreshop.category.filter
* @return null|\CoreShop\Component\Index\Model\FilterInterface
*/
public function getFilter(): ?\CoreShop\Component\Index\Model\FilterInterface
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("filter");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("filter")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set filter - coreshop.category.filter
* @param null|\CoreShop\Component\Index\Model\FilterInterface $filter
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setFilter(?\CoreShop\Component\Index\Model\FilterInterface $filter)
{
/** @var \CoreShop\Bundle\IndexBundle\CoreExtension\Filter $fd */
$fd = $this->getClass()->getFieldDefinition("filter");
$this->filter = $fd->preSetData($this, $filter);
return $this;
}
/**
* Get stores - coreshop.category.stores
* @return string[]|null
*/
public function getStores(): ?array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("stores");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("stores")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set stores - coreshop.category.stores
* @param string[]|null $stores
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setStores(?array $stores)
{
$this->stores = $stores;
return $this;
}
/**
* Get parentCategory - coreshop.category.parent_category
* @return ?\CoreShop\Component\Product\Model\CategoryInterface
*/
public function getParentCategory(): ?\CoreShop\Component\Product\Model\CategoryInterface
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("parentCategory");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("parentCategory")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set parentCategory - coreshop.category.parent_category
* @param ?\CoreShop\Component\Product\Model\CategoryInterface $parentCategory
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setParentCategory(?\CoreShop\Component\Product\Model\CategoryInterface $parentCategory)
{
/** @var \CoreShop\Bundle\ResourceBundle\CoreExtension\CoreShopRelation $fd */
$fd = $this->getClass()->getFieldDefinition("parentCategory");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getParentCategory();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $parentCategory);
if (!$isEqual) {
$this->markFieldDirty("parentCategory", true);
}
$this->parentCategory = $fd->preSetData($this, $parentCategory);
return $this;
}
/**
* Get workingName - Working Name
* @return string|null
*/
public function getWorkingName(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("workingName");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->workingName;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set workingName - Working Name
* @param string|null $workingName
* @return \Pimcore\Model\DataObject\CoreShopCategory
*/
public function setWorkingName(?string $workingName)
{
$this->workingName = $workingName;
return $this;
}
}