<?php
/**
* Inheritance: yes
* Variants: yes
*
* Fields Summary:
* - localizedfields [localizedfields]
* -- Name [input]
* -- Content [input]
* -- Description [wysiwyg]
* -- VideoList [manyToManyRelation]
* -- DocumentList [manyToManyRelation]
* - Category [advancedManyToManyObjectRelation]
* - Brand [advancedManyToManyObjectRelation]
* - CountryAvailabilityList [advancedManyToManyObjectRelation]
* - bottleSize [select]
* - DocumentImage [image]
* - images [imageGallery]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByContent($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByVideoList($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByDocumentList($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByBrand($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByCountryAvailabilityList($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByBottleSize($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\BrandExtension\Listing|\Pimcore\Model\DataObject\BrandExtension|null getByDocumentImage($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class BrandExtension extends \Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractProduct
{
protected $o_classId = "32";
protected $o_className = "BrandExtension";
protected $localizedfields;
protected $Category;
protected $Brand;
protected $CountryAvailabilityList;
protected $bottleSize;
protected $DocumentImage;
protected $images;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\BrandExtension
*/
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()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("localizedfields");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("localizedfields")->isEmpty($data)) {
try {
return $this->getValueFromParent("localizedfields");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get Name - Name
* @return string|null
*/
public function getName($language = null)
{
$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 Content - Content
* @return string|null
*/
public function getContent($language = null)
{
$data = $this->getLocalizedfields()->getLocalizedValue("Content", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Content");
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)
{
$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 VideoList - Video List
* @return \Pimcore\Model\Asset\Video[]
*/
public function getVideoList($language = null)
{
$data = $this->getLocalizedfields()->getLocalizedValue("VideoList", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("VideoList");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get DocumentList - Document List
* @return \Pimcore\Model\Asset\Folder[] | \Pimcore\Model\Asset\Image[] | \Pimcore\Model\Asset\Text[] | \Pimcore\Model\Asset\Audio[] | \Pimcore\Model\Asset\Unknown[] | \Pimcore\Model\Asset\Document[] | \Pimcore\Model\Asset\Archive[]
*/
public function getDocumentList($language = null)
{
$data = $this->getLocalizedfields()->getLocalizedValue("DocumentList", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("DocumentList");
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\BrandExtension
*/
public function setLocalizedfields($localizedfields)
{
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getLocalizedfields();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$this->markFieldDirty("localizedfields", true);
$this->localizedfields = $localizedfields;
return $this;
}
/**
* Set Name - Name
* @param string|null $Name
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setName ($Name, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("Name", $Name, $language, !$isEqual);
return $this;
}
/**
* Set Content - Content
* @param string|null $Content
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setContent ($Content, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("Content", $Content, $language, !$isEqual);
return $this;
}
/**
* Set Description - Description
* @param string|null $Description
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setDescription ($Description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("Description", $Description, $language, !$isEqual);
return $this;
}
/**
* Set VideoList - Video List
* @param \Pimcore\Model\Asset\Video[] $VideoList
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setVideoList ($VideoList, $language = null)
{
$fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("VideoList");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getVideoList($language);
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $VideoList);
if (!$isEqual) {
$this->markFieldDirty("VideoList", true);
}
$this->getLocalizedfields()->setLocalizedValue("VideoList", $VideoList, $language, !$isEqual);
return $this;
}
/**
* Set DocumentList - Document List
* @param \Pimcore\Model\Asset\Folder[] | \Pimcore\Model\Asset\Image[] | \Pimcore\Model\Asset\Text[] | \Pimcore\Model\Asset\Audio[] | \Pimcore\Model\Asset\Unknown[] | \Pimcore\Model\Asset\Document[] | \Pimcore\Model\Asset\Archive[] $DocumentList
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setDocumentList ($DocumentList, $language = null)
{
$fd = $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("DocumentList");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getDocumentList($language);
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $DocumentList);
if (!$isEqual) {
$this->markFieldDirty("DocumentList", true);
}
$this->getLocalizedfields()->setLocalizedValue("DocumentList", $DocumentList, $language, !$isEqual);
return $this;
}
/**
* Get Category - Category
* @return \Pimcore\Model\DataObject\Data\ObjectMetadata[]
*/
public function getCategory()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Category");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("Category")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Category")->isEmpty($data)) {
try {
return $this->getValueFromParent("Category");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set Category - Category
* @param \Pimcore\Model\DataObject\Data\ObjectMetadata[] $Category
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setCategory($Category)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\AdvancedManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("Category");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getCategory();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $Category);
if (!$isEqual) {
$this->markFieldDirty("Category", true);
}
$this->Category = $fd->preSetData($this, $Category);
return $this;
}
/**
* Get Brand - Item Type
* @return \Pimcore\Model\DataObject\Data\ObjectMetadata[]
*/
public function getBrand()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("Brand");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("Brand")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Brand")->isEmpty($data)) {
try {
return $this->getValueFromParent("Brand");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set Brand - Item Type
* @param \Pimcore\Model\DataObject\Data\ObjectMetadata[] $Brand
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setBrand($Brand)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\AdvancedManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("Brand");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getBrand();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $Brand);
if (!$isEqual) {
$this->markFieldDirty("Brand", true);
}
$this->Brand = $fd->preSetData($this, $Brand);
return $this;
}
/**
* Get CountryAvailabilityList - Country Availability List
* @return \Pimcore\Model\DataObject\Data\ObjectMetadata[]
*/
public function getCountryAvailabilityList()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("CountryAvailabilityList");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("CountryAvailabilityList")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("CountryAvailabilityList")->isEmpty($data)) {
try {
return $this->getValueFromParent("CountryAvailabilityList");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set CountryAvailabilityList - Country Availability List
* @param \Pimcore\Model\DataObject\Data\ObjectMetadata[] $CountryAvailabilityList
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setCountryAvailabilityList($CountryAvailabilityList)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\AdvancedManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("CountryAvailabilityList");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getCountryAvailabilityList();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $CountryAvailabilityList);
if (!$isEqual) {
$this->markFieldDirty("CountryAvailabilityList", true);
}
$this->CountryAvailabilityList = $fd->preSetData($this, $CountryAvailabilityList);
return $this;
}
/**
* Get bottleSize - Bottle Photo
* @return string|null
*/
public function getBottleSize()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("bottleSize");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->bottleSize;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("bottleSize")->isEmpty($data)) {
try {
return $this->getValueFromParent("bottleSize");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set bottleSize - Bottle Photo
* @param string|null $bottleSize
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setBottleSize($bottleSize)
{
$this->bottleSize = $bottleSize;
return $this;
}
/**
* Get DocumentImage - DocumentImage
* @return \Pimcore\Model\Asset\Image|null
*/
public function getDocumentImage()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("DocumentImage");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->DocumentImage;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("DocumentImage")->isEmpty($data)) {
try {
return $this->getValueFromParent("DocumentImage");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set DocumentImage - DocumentImage
* @param \Pimcore\Model\Asset\Image|null $DocumentImage
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setDocumentImage($DocumentImage)
{
$this->DocumentImage = $DocumentImage;
return $this;
}
/**
* Get images - Images
* @return \Pimcore\Model\DataObject\Data\ImageGallery|null
*/
public function getImages()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("images");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->images;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("images")->isEmpty($data)) {
try {
return $this->getValueFromParent("images");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set images - Images
* @param \Pimcore\Model\DataObject\Data\ImageGallery|null $images
* @return \Pimcore\Model\DataObject\BrandExtension
*/
public function setImages($images)
{
$this->images = $images;
return $this;
}
}