<?php
/**
* Inheritance: yes
* Variants: no
Fields Summary:
- localizedfields [localizedfields]
-- name [input]
-- description [textarea]
-- ingredients [textarea]
-- size [input]
-- meta_title [input]
-- meta_description [textarea]
- featured [booleanSelect]
- code [input]
- cuisine [select]
- meal_type [select]
- productattr [manyToManyObjectRelation]
- categories [manyToManyObjectRelation]
- subCategory [manyToOneRelation]
- brands [manyToOneRelation]
- recipes [manyToManyObjectRelation]
- bought_with [manyToManyObjectRelation]
- related_products [manyToManyObjectRelation]
- image [image]
- url [input]
- region [block]
-- country [country]
-- price [numeric]
-- currency_symbol [input]
- usage_info [block]
-- localizedfields [localizedfields]
--- usage_property [input]
--- usage_value [input]
- nutritionspersize [input]
- nutrition [block]
-- localizedfields [localizedfields]
--- nutritions [input]
--- qty [input]
- attrimage [imageGallery]
- product_info [block]
-- localizedfields [localizedfields]
--- product_info_name [input]
--- product_info_value [input]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\Products\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByIngredients($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getBySize($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByMeta_title($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByMeta_description($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByCode($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByCuisine($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByMeal_type($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByProductattr($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByCategories($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getBySubCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByBrands($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByRecipes($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByBought_with($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByRelated_products($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByImage($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByUrl($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\Products\Listing|\Pimcore\Model\DataObject\Products|null getByNutritionspersize($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class Products extends \App\Model\Product\AbstractProduct
{
protected $o_classId = "1";
protected $o_className = "products";
protected $localizedfields;
protected $featured;
protected $code;
protected $cuisine;
protected $meal_type;
protected $productattr;
protected $categories;
protected $subCategory;
protected $brands;
protected $recipes;
protected $bought_with;
protected $related_products;
protected $image;
protected $url;
protected $region;
protected $usage_info;
protected $nutritionspersize;
protected $nutrition;
protected $attrimage;
protected $product_info;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\Products
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get localizedfields - Language
* @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 (\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): ?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 - 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 ingredients - ingredients
* @return string|null
*/
public function getIngredients($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("ingredients", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("ingredients");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get size - Size
* @return string|null
*/
public function getSize($language = null): ?string
{
$data = $this->getLocalizedfields()->getLocalizedValue("size", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("size");
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 - Language
* @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
* @return \Pimcore\Model\DataObject\Products
*/
public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $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\Products
*/
public function setName (?string $name, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("name", $name, $language, !$isEqual);
return $this;
}
/**
* Set description - Description
* @param string|null $description
* @return \Pimcore\Model\DataObject\Products
*/
public function setDescription (?string $description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("description", $description, $language, !$isEqual);
return $this;
}
/**
* Set ingredients - ingredients
* @param string|null $ingredients
* @return \Pimcore\Model\DataObject\Products
*/
public function setIngredients (?string $ingredients, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("ingredients", $ingredients, $language, !$isEqual);
return $this;
}
/**
* Set size - Size
* @param string|null $size
* @return \Pimcore\Model\DataObject\Products
*/
public function setSize (?string $size, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("size", $size, $language, !$isEqual);
return $this;
}
/**
* Set meta_title - Meta Title
* @param string|null $meta_title
* @return \Pimcore\Model\DataObject\Products
*/
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\Products
*/
public function setMeta_description (?string $meta_description, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("meta_description", $meta_description, $language, !$isEqual);
return $this;
}
/**
* Get featured - Featured Product
* @return bool|null
*/
public function getFeatured(): ?bool
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("featured");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->featured;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("featured")->isEmpty($data)) {
try {
return $this->getValueFromParent("featured");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set featured - Featured Product
* @param bool|null $featured
* @return \Pimcore\Model\DataObject\Products
*/
public function setFeatured(?bool $featured)
{
$this->featured = $featured;
return $this;
}
/**
* Get code - code
* @return string|null
*/
public function getCode(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("code");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->code;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("code")->isEmpty($data)) {
try {
return $this->getValueFromParent("code");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set code - code
* @param string|null $code
* @return \Pimcore\Model\DataObject\Products
*/
public function setCode(?string $code)
{
$this->code = $code;
return $this;
}
/**
* Get cuisine - Cuisine
* @return string|null
*/
public function getCuisine(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("cuisine");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->cuisine;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("cuisine")->isEmpty($data)) {
try {
return $this->getValueFromParent("cuisine");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set cuisine - Cuisine
* @param string|null $cuisine
* @return \Pimcore\Model\DataObject\Products
*/
public function setCuisine(?string $cuisine)
{
$this->cuisine = $cuisine;
return $this;
}
/**
* Get meal_type - Meal Type
* @return string|null
*/
public function getMeal_type(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("meal_type");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->meal_type;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("meal_type")->isEmpty($data)) {
try {
return $this->getValueFromParent("meal_type");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set meal_type - Meal Type
* @param string|null $meal_type
* @return \Pimcore\Model\DataObject\Products
*/
public function setMeal_type(?string $meal_type)
{
$this->meal_type = $meal_type;
return $this;
}
/**
* Get productattr - Product Attributes
* @return \Pimcore\Model\DataObject\Productattribute[]
*/
public function getProductattr(): array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("productattr");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("productattr")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("productattr")->isEmpty($data)) {
try {
return $this->getValueFromParent("productattr");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set productattr - Product Attributes
* @param \Pimcore\Model\DataObject\Productattribute[] $productattr
* @return \Pimcore\Model\DataObject\Products
*/
public function setProductattr(?array $productattr)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("productattr");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getProductattr();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $productattr);
if (!$isEqual) {
$this->markFieldDirty("productattr", true);
}
$this->productattr = $fd->preSetData($this, $productattr);
return $this;
}
/**
* Get categories - Categories
* @return \Pimcore\Model\DataObject\Category[]
*/
public function getCategories(): array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("categories");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("categories")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("categories")->isEmpty($data)) {
try {
return $this->getValueFromParent("categories");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set categories - Categories
* @param \Pimcore\Model\DataObject\Category[] $categories
* @return \Pimcore\Model\DataObject\Products
*/
public function setCategories(?array $categories)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("categories");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getCategories();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $categories);
if (!$isEqual) {
$this->markFieldDirty("categories", true);
}
$this->categories = $fd->preSetData($this, $categories);
return $this;
}
/**
* Get subCategory - Sub Category
* @return \Pimcore\Model\DataObject\SubCategory|null
*/
public function getSubCategory(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("subCategory");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("subCategory")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("subCategory")->isEmpty($data)) {
try {
return $this->getValueFromParent("subCategory");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set subCategory - Sub Category
* @param \Pimcore\Model\DataObject\SubCategory $subCategory
* @return \Pimcore\Model\DataObject\Products
*/
public function setSubCategory(?\Pimcore\Model\Element\AbstractElement $subCategory)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("subCategory");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getSubCategory();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $subCategory);
if (!$isEqual) {
$this->markFieldDirty("subCategory", true);
}
$this->subCategory = $fd->preSetData($this, $subCategory);
return $this;
}
/**
* Get brands - Brands
* @return \Pimcore\Model\DataObject\Brands|null
*/
public function getBrands(): ?\Pimcore\Model\Element\AbstractElement
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("brands");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("brands")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("brands")->isEmpty($data)) {
try {
return $this->getValueFromParent("brands");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set brands - Brands
* @param \Pimcore\Model\DataObject\Brands $brands
* @return \Pimcore\Model\DataObject\Products
*/
public function setBrands(?\Pimcore\Model\Element\AbstractElement $brands)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
$fd = $this->getClass()->getFieldDefinition("brands");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getBrands();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $brands);
if (!$isEqual) {
$this->markFieldDirty("brands", true);
}
$this->brands = $fd->preSetData($this, $brands);
return $this;
}
/**
* Get recipes - Recipes
* @return \Pimcore\Model\DataObject\Recipe[]
*/
public function getRecipes(): array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("recipes");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("recipes")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("recipes")->isEmpty($data)) {
try {
return $this->getValueFromParent("recipes");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set recipes - Recipes
* @param \Pimcore\Model\DataObject\Recipe[] $recipes
* @return \Pimcore\Model\DataObject\Products
*/
public function setRecipes(?array $recipes)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("recipes");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getRecipes();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $recipes);
if (!$isEqual) {
$this->markFieldDirty("recipes", true);
}
$this->recipes = $fd->preSetData($this, $recipes);
return $this;
}
/**
* Get bought_with - Bought Together
* @return \Pimcore\Model\DataObject\Products[]
*/
public function getBought_with(): array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("bought_with");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("bought_with")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("bought_with")->isEmpty($data)) {
try {
return $this->getValueFromParent("bought_with");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set bought_with - Bought Together
* @param \Pimcore\Model\DataObject\Products[] $bought_with
* @return \Pimcore\Model\DataObject\Products
*/
public function setBought_with(?array $bought_with)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("bought_with");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getBought_with();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $bought_with);
if (!$isEqual) {
$this->markFieldDirty("bought_with", true);
}
$this->bought_with = $fd->preSetData($this, $bought_with);
return $this;
}
/**
* Get related_products - Related Products
* @return \Pimcore\Model\DataObject\Products[]
*/
public function getRelated_products(): array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("related_products");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("related_products")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("related_products")->isEmpty($data)) {
try {
return $this->getValueFromParent("related_products");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set related_products - Related Products
* @param \Pimcore\Model\DataObject\Products[] $related_products
* @return \Pimcore\Model\DataObject\Products
*/
public function setRelated_products(?array $related_products)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("related_products");
$inheritValues = self::getGetInheritedValues();
self::setGetInheritedValues(false);
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getRelated_products();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
self::setGetInheritedValues($inheritValues);
$isEqual = $fd->isEqual($currentData, $related_products);
if (!$isEqual) {
$this->markFieldDirty("related_products", true);
}
$this->related_products = $fd->preSetData($this, $related_products);
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 (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("image")->isEmpty($data)) {
try {
return $this->getValueFromParent("image");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
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\Products
*/
public function setImage(?\Pimcore\Model\Asset\Image $image)
{
$this->image = $image;
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 (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("url")->isEmpty($data)) {
try {
return $this->getValueFromParent("url");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set url - Url
* @param string|null $url
* @return \Pimcore\Model\DataObject\Products
*/
public function setUrl(?string $url)
{
$this->url = $url;
return $this;
}
/**
* Get region - region
* @return \Pimcore\Model\DataObject\Data\BlockElement[][]
*/
public function getRegion(): ?array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("region");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("region")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("region")->isEmpty($data)) {
try {
return $this->getValueFromParent("region");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set region - region
* @param \Pimcore\Model\DataObject\Data\BlockElement[][] $region
* @return \Pimcore\Model\DataObject\Products
*/
public function setRegion(?array $region)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
$fd = $this->getClass()->getFieldDefinition("region");
$this->region = $fd->preSetData($this, $region);
return $this;
}
/**
* Get usage_info - usage_info
* @return \Pimcore\Model\DataObject\Data\BlockElement[][]
*/
public function getUsage_info(): ?array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("usage_info");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("usage_info")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("usage_info")->isEmpty($data)) {
try {
return $this->getValueFromParent("usage_info");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set usage_info - usage_info
* @param \Pimcore\Model\DataObject\Data\BlockElement[][] $usage_info
* @return \Pimcore\Model\DataObject\Products
*/
public function setUsage_info(?array $usage_info)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
$fd = $this->getClass()->getFieldDefinition("usage_info");
$this->usage_info = $fd->preSetData($this, $usage_info);
return $this;
}
/**
* Get nutritionspersize - Nutrition Per Size
* @return string|null
*/
public function getNutritionspersize(): ?string
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("nutritionspersize");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->nutritionspersize;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("nutritionspersize")->isEmpty($data)) {
try {
return $this->getValueFromParent("nutritionspersize");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set nutritionspersize - Nutrition Per Size
* @param string|null $nutritionspersize
* @return \Pimcore\Model\DataObject\Products
*/
public function setNutritionspersize(?string $nutritionspersize)
{
$this->nutritionspersize = $nutritionspersize;
return $this;
}
/**
* Get nutrition - Nutrition
* @return \Pimcore\Model\DataObject\Data\BlockElement[][]
*/
public function getNutrition(): ?array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("nutrition");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("nutrition")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("nutrition")->isEmpty($data)) {
try {
return $this->getValueFromParent("nutrition");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set nutrition - Nutrition
* @param \Pimcore\Model\DataObject\Data\BlockElement[][] $nutrition
* @return \Pimcore\Model\DataObject\Products
*/
public function setNutrition(?array $nutrition)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
$fd = $this->getClass()->getFieldDefinition("nutrition");
$this->nutrition = $fd->preSetData($this, $nutrition);
return $this;
}
/**
* Get attrimage - attrimage
* @return \Pimcore\Model\DataObject\Data\ImageGallery|null
*/
public function getAttrimage(): ?\Pimcore\Model\DataObject\Data\ImageGallery
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("attrimage");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->attrimage;
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("attrimage")->isEmpty($data)) {
try {
return $this->getValueFromParent("attrimage");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set attrimage - attrimage
* @param \Pimcore\Model\DataObject\Data\ImageGallery|null $attrimage
* @return \Pimcore\Model\DataObject\Products
*/
public function setAttrimage(?\Pimcore\Model\DataObject\Data\ImageGallery $attrimage)
{
$this->attrimage = $attrimage;
return $this;
}
/**
* Get product_info - Product Info
* @return \Pimcore\Model\DataObject\Data\BlockElement[][]
*/
public function getProduct_info(): ?array
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("product_info");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("product_info")->preGetData($this);
if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("product_info")->isEmpty($data)) {
try {
return $this->getValueFromParent("product_info");
} catch (InheritanceParentNotFoundException $e) {
// no data from parent available, continue ...
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set product_info - Product Info
* @param \Pimcore\Model\DataObject\Data\BlockElement[][] $product_info
* @return \Pimcore\Model\DataObject\Products
*/
public function setProduct_info(?array $product_info)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Block $fd */
$fd = $this->getClass()->getFieldDefinition("product_info");
$this->product_info = $fd->preSetData($this, $product_info);
return $this;
}
}