var/classes/DataObject/Product.php line 860

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: yes
  4.  * Variants: yes
  5.  *
  6.  * Fields Summary:
  7.  * - ProductType [select]
  8.  * - Visibility [select]
  9.  * - Name [input]
  10.  * - Images [imageGallery]
  11.  * - SKU [input]
  12.  * - BasePrice [quantityValue]
  13.  * - MinBasePrice [calculatedValue]
  14.  * - PriceSystemRuleRelation [manyToOneRelation]
  15.  * - PriceSystemRulePath [calculatedValue]
  16.  * - PriceSystemRuleId [numeric]
  17.  * - Division [calculatedValue]
  18.  * - ShortDescription [wysiwyg]
  19.  * - Categories [manyToManyObjectRelation]
  20.  * - RelatedProducts [manyToManyObjectRelation]
  21.  * - PurchasedTogether [manyToManyObjectRelation]
  22.  * - ReplacementParts [manyToManyObjectRelation]
  23.  * - Products [manyToManyObjectRelation]
  24.  * - AdditionalContent [fieldcollections]
  25.  * - Weight [quantityValue]
  26.  * - Width [quantityValue]
  27.  * - Height [quantityValue]
  28.  * - Length [quantityValue]
  29.  * - URLKey [input]
  30.  * - URLPath [input]
  31.  * - MetaTitle [input]
  32.  * - MetaDescription [textarea]
  33.  * - MetaKeywords [input]
  34.  * - OgImage [image]
  35.  * - OgTitle [input]
  36.  * - OgDescription [textarea]
  37.  * - StockStatus [select]
  38.  */
  39. namespace Pimcore\Model\DataObject;
  40. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  41. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  42. /**
  43. * @method static \Pimcore\Model\DataObject\Product\Listing getList(array $config = [])
  44. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByProductType($value, $limit = 0, $offset = 0, $objectTypes = null)
  45. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByVisibility($value, $limit = 0, $offset = 0, $objectTypes = null)
  46. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByName($value, $limit = 0, $offset = 0, $objectTypes = null)
  47. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getBySKU($value, $limit = 0, $offset = 0, $objectTypes = null)
  48. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByPriceSystemRuleRelation($value, $limit = 0, $offset = 0, $objectTypes = null)
  49. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByPriceSystemRuleId($value, $limit = 0, $offset = 0, $objectTypes = null)
  50. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByShortDescription($value, $limit = 0, $offset = 0, $objectTypes = null)
  51. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByCategories($value, $limit = 0, $offset = 0, $objectTypes = null)
  52. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByRelatedProducts($value, $limit = 0, $offset = 0, $objectTypes = null)
  53. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByPurchasedTogether($value, $limit = 0, $offset = 0, $objectTypes = null)
  54. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByReplacementParts($value, $limit = 0, $offset = 0, $objectTypes = null)
  55. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByProducts($value, $limit = 0, $offset = 0, $objectTypes = null)
  56. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByURLKey($value, $limit = 0, $offset = 0, $objectTypes = null)
  57. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByURLPath($value, $limit = 0, $offset = 0, $objectTypes = null)
  58. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByMetaTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  59. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByMetaDescription($value, $limit = 0, $offset = 0, $objectTypes = null)
  60. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByMetaKeywords($value, $limit = 0, $offset = 0, $objectTypes = null)
  61. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByOgImage($value, $limit = 0, $offset = 0, $objectTypes = null)
  62. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByOgTitle($value, $limit = 0, $offset = 0, $objectTypes = null)
  63. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByOgDescription($value, $limit = 0, $offset = 0, $objectTypes = null)
  64. * @method static \Pimcore\Model\DataObject\Product\Listing|\Pimcore\Model\DataObject\Product|null getByStockStatus($value, $limit = 0, $offset = 0, $objectTypes = null)
  65. */
  66. class Product extends \App\Model\Product\ProductBase
  67. {
  68. protected $o_classId "Product";
  69. protected $o_className "Product";
  70. protected $ProductType;
  71. protected $Visibility;
  72. protected $Name;
  73. protected $Images;
  74. protected $SKU;
  75. protected $BasePrice;
  76. protected $PriceSystemRuleRelation;
  77. protected $PriceSystemRuleId;
  78. protected $ShortDescription;
  79. protected $Categories;
  80. protected $RelatedProducts;
  81. protected $PurchasedTogether;
  82. protected $ReplacementParts;
  83. protected $Products;
  84. protected $AdditionalContent;
  85. protected $Weight;
  86. protected $Width;
  87. protected $Height;
  88. protected $Length;
  89. protected $URLKey;
  90. protected $URLPath;
  91. protected $MetaTitle;
  92. protected $MetaDescription;
  93. protected $MetaKeywords;
  94. protected $OgImage;
  95. protected $OgTitle;
  96. protected $OgDescription;
  97. protected $StockStatus;
  98. /**
  99. * @param array $values
  100. * @return \Pimcore\Model\DataObject\Product
  101. */
  102. public static function create($values = array()) {
  103.     $object = new static();
  104.     $object->setValues($values);
  105.     return $object;
  106. }
  107. /**
  108. * Get ProductType - Product Type
  109. * @return string|null
  110. */
  111. public function getProductType(): ?string
  112. {
  113.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  114.         $preValue $this->preGetValue("ProductType");
  115.         if ($preValue !== null) {
  116.             return $preValue;
  117.         }
  118.     }
  119.     $data $this->ProductType;
  120.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("ProductType")->isEmpty($data)) {
  121.         try {
  122.             return $this->getValueFromParent("ProductType");
  123.         } catch (InheritanceParentNotFoundException $e) {
  124.             // no data from parent available, continue ...
  125.         }
  126.     }
  127.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  128.         return $data->getPlain();
  129.     }
  130.     return $data;
  131. }
  132. /**
  133. * Set ProductType - Product Type
  134. * @param string|null $ProductType
  135. * @return \Pimcore\Model\DataObject\Product
  136. */
  137. public function setProductType(?string $ProductType)
  138. {
  139.     $this->ProductType $ProductType;
  140.     return $this;
  141. }
  142. /**
  143. * Get Visibility - Visibility
  144. * @return string|null
  145. */
  146. public function getVisibility(): ?string
  147. {
  148.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  149.         $preValue $this->preGetValue("Visibility");
  150.         if ($preValue !== null) {
  151.             return $preValue;
  152.         }
  153.     }
  154.     $data $this->Visibility;
  155.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Visibility")->isEmpty($data)) {
  156.         try {
  157.             return $this->getValueFromParent("Visibility");
  158.         } catch (InheritanceParentNotFoundException $e) {
  159.             // no data from parent available, continue ...
  160.         }
  161.     }
  162.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  163.         return $data->getPlain();
  164.     }
  165.     return $data;
  166. }
  167. /**
  168. * Set Visibility - Visibility
  169. * @param string|null $Visibility
  170. * @return \Pimcore\Model\DataObject\Product
  171. */
  172. public function setVisibility(?string $Visibility)
  173. {
  174.     $this->Visibility $Visibility;
  175.     return $this;
  176. }
  177. /**
  178. * Get Name - Name
  179. * @return string|null
  180. */
  181. public function getName(): ?string
  182. {
  183.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  184.         $preValue $this->preGetValue("Name");
  185.         if ($preValue !== null) {
  186.             return $preValue;
  187.         }
  188.     }
  189.     $data $this->Name;
  190.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Name")->isEmpty($data)) {
  191.         try {
  192.             return $this->getValueFromParent("Name");
  193.         } catch (InheritanceParentNotFoundException $e) {
  194.             // no data from parent available, continue ...
  195.         }
  196.     }
  197.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  198.         return $data->getPlain();
  199.     }
  200.     return $data;
  201. }
  202. /**
  203. * Set Name - Name
  204. * @param string|null $Name
  205. * @return \Pimcore\Model\DataObject\Product
  206. */
  207. public function setName(?string $Name)
  208. {
  209.     $this->Name $Name;
  210.     return $this;
  211. }
  212. /**
  213. * Get Images - Images
  214. * @return \Pimcore\Model\DataObject\Data\ImageGallery|null
  215. */
  216. public function getImages(): ?\Pimcore\Model\DataObject\Data\ImageGallery
  217. {
  218.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  219.         $preValue $this->preGetValue("Images");
  220.         if ($preValue !== null) {
  221.             return $preValue;
  222.         }
  223.     }
  224.     $data $this->Images;
  225.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Images")->isEmpty($data)) {
  226.         try {
  227.             return $this->getValueFromParent("Images");
  228.         } catch (InheritanceParentNotFoundException $e) {
  229.             // no data from parent available, continue ...
  230.         }
  231.     }
  232.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  233.         return $data->getPlain();
  234.     }
  235.     return $data;
  236. }
  237. /**
  238. * Set Images - Images
  239. * @param \Pimcore\Model\DataObject\Data\ImageGallery|null $Images
  240. * @return \Pimcore\Model\DataObject\Product
  241. */
  242. public function setImages(?\Pimcore\Model\DataObject\Data\ImageGallery $Images)
  243. {
  244.     $this->Images $Images;
  245.     return $this;
  246. }
  247. /**
  248. * Get SKU - SKU
  249. * @return string|null
  250. */
  251. public function getSKU(): ?string
  252. {
  253.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  254.         $preValue $this->preGetValue("SKU");
  255.         if ($preValue !== null) {
  256.             return $preValue;
  257.         }
  258.     }
  259.     $data $this->SKU;
  260.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("SKU")->isEmpty($data)) {
  261.         try {
  262.             return $this->getValueFromParent("SKU");
  263.         } catch (InheritanceParentNotFoundException $e) {
  264.             // no data from parent available, continue ...
  265.         }
  266.     }
  267.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  268.         return $data->getPlain();
  269.     }
  270.     return $data;
  271. }
  272. /**
  273. * Set SKU - SKU
  274. * @param string|null $SKU
  275. * @return \Pimcore\Model\DataObject\Product
  276. */
  277. public function setSKU(?string $SKU)
  278. {
  279.     $this->SKU $SKU;
  280.     return $this;
  281. }
  282. /**
  283. * Get BasePrice - Base Price
  284. * @return \Pimcore\Model\DataObject\Data\QuantityValue|null
  285. */
  286. public function getBasePrice(): ?\Pimcore\Model\DataObject\Data\QuantityValue
  287. {
  288.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  289.         $preValue $this->preGetValue("BasePrice");
  290.         if ($preValue !== null) {
  291.             return $preValue;
  292.         }
  293.     }
  294.     $data $this->BasePrice;
  295.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("BasePrice")->isEmpty($data)) {
  296.         try {
  297.             return $this->getValueFromParent("BasePrice");
  298.         } catch (InheritanceParentNotFoundException $e) {
  299.             // no data from parent available, continue ...
  300.         }
  301.     }
  302.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  303.         return $data->getPlain();
  304.     }
  305.     return $data;
  306. }
  307. /**
  308. * Set BasePrice - Base Price
  309. * @param \Pimcore\Model\DataObject\Data\QuantityValue|null $BasePrice
  310. * @return \Pimcore\Model\DataObject\Product
  311. */
  312. public function setBasePrice(?\Pimcore\Model\DataObject\Data\QuantityValue $BasePrice)
  313. {
  314.     $this->BasePrice $BasePrice;
  315.     return $this;
  316. }
  317. /**
  318. * Get MinBasePrice - MinBasePrice
  319. * @return \Pimcore\Model\DataObject\Data\CalculatedValue|null
  320. */
  321. public function getMinBasePrice()
  322. {
  323.     $data = new \Pimcore\Model\DataObject\Data\CalculatedValue('MinBasePrice');
  324.     $data->setContextualData("object"nullnullnull);
  325.     $object $this;
  326.     $data \Pimcore\Model\DataObject\Service::getCalculatedFieldValue($object$data);
  327.     return $data;
  328. }
  329. /**
  330. * Set MinBasePrice - MinBasePrice
  331. * @param \Pimcore\Model\DataObject\Data\CalculatedValue|null $MinBasePrice
  332. * @return \Pimcore\Model\DataObject\Product
  333. */
  334. public function setMinBasePrice($MinBasePrice)
  335. {
  336.     return $this;
  337. }
  338. /**
  339. * Get PriceSystemRuleRelation - PriceSystemRule
  340. * @return \Pimcore\Model\DataObject\PriceSystemRule|null
  341. */
  342. public function getPriceSystemRuleRelation(): ?\Pimcore\Model\Element\AbstractElement
  343. {
  344.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  345.         $preValue $this->preGetValue("PriceSystemRuleRelation");
  346.         if ($preValue !== null) {
  347.             return $preValue;
  348.         }
  349.     }
  350.     $data $this->getClass()->getFieldDefinition("PriceSystemRuleRelation")->preGetData($this);
  351.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("PriceSystemRuleRelation")->isEmpty($data)) {
  352.         try {
  353.             return $this->getValueFromParent("PriceSystemRuleRelation");
  354.         } catch (InheritanceParentNotFoundException $e) {
  355.             // no data from parent available, continue ...
  356.         }
  357.     }
  358.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  359.         return $data->getPlain();
  360.     }
  361.     return $data;
  362. }
  363. /**
  364. * Set PriceSystemRuleRelation - PriceSystemRule
  365. * @param \Pimcore\Model\DataObject\PriceSystemRule|null $PriceSystemRuleRelation
  366. * @return \Pimcore\Model\DataObject\Product
  367. */
  368. public function setPriceSystemRuleRelation(?\Pimcore\Model\Element\AbstractElement $PriceSystemRuleRelation)
  369. {
  370.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  371.     $fd $this->getClass()->getFieldDefinition("PriceSystemRuleRelation");
  372.     $inheritValues self::getGetInheritedValues();
  373.     self::setGetInheritedValues(false);
  374.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  375.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  376.     $currentData $this->getPriceSystemRuleRelation();
  377.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  378.     self::setGetInheritedValues($inheritValues);
  379.     $isEqual $fd->isEqual($currentData$PriceSystemRuleRelation);
  380.     if (!$isEqual) {
  381.         $this->markFieldDirty("PriceSystemRuleRelation"true);
  382.     }
  383.     $this->PriceSystemRuleRelation $fd->preSetData($this$PriceSystemRuleRelation);
  384.     return $this;
  385. }
  386. /**
  387. * Get PriceSystemRulePath - PricingSystemRuleId
  388. * @return \Pimcore\Model\DataObject\Data\CalculatedValue|null
  389. */
  390. public function getPriceSystemRulePath()
  391. {
  392.     $data = new \Pimcore\Model\DataObject\Data\CalculatedValue('PriceSystemRulePath');
  393.     $data->setContextualData("object"nullnullnull);
  394.     $object $this;
  395.     $data \Pimcore\Model\DataObject\Service::getCalculatedFieldValue($object$data);
  396.     return $data;
  397. }
  398. /**
  399. * Set PriceSystemRulePath - PricingSystemRuleId
  400. * @param \Pimcore\Model\DataObject\Data\CalculatedValue|null $PriceSystemRulePath
  401. * @return \Pimcore\Model\DataObject\Product
  402. */
  403. public function setPriceSystemRulePath($PriceSystemRulePath)
  404. {
  405.     return $this;
  406. }
  407. /**
  408. * Get PriceSystemRuleId - PriceSystemRuleId
  409. * @return float|null
  410. */
  411. public function getPriceSystemRuleId(): ?float
  412. {
  413.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  414.         $preValue $this->preGetValue("PriceSystemRuleId");
  415.         if ($preValue !== null) {
  416.             return $preValue;
  417.         }
  418.     }
  419.     $data $this->PriceSystemRuleId;
  420.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("PriceSystemRuleId")->isEmpty($data)) {
  421.         try {
  422.             return $this->getValueFromParent("PriceSystemRuleId");
  423.         } catch (InheritanceParentNotFoundException $e) {
  424.             // no data from parent available, continue ...
  425.         }
  426.     }
  427.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  428.         return $data->getPlain();
  429.     }
  430.     return $data;
  431. }
  432. /**
  433. * Set PriceSystemRuleId - PriceSystemRuleId
  434. * @param float|null $PriceSystemRuleId
  435. * @return \Pimcore\Model\DataObject\Product
  436. */
  437. public function setPriceSystemRuleId(?float $PriceSystemRuleId)
  438. {
  439.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  440.     $fd $this->getClass()->getFieldDefinition("PriceSystemRuleId");
  441.     $this->PriceSystemRuleId $fd->preSetData($this$PriceSystemRuleId);
  442.     return $this;
  443. }
  444. /**
  445. * Get Division - Division
  446. * @return \Pimcore\Model\DataObject\Data\CalculatedValue|null
  447. */
  448. public function getDivision()
  449. {
  450.     $data = new \Pimcore\Model\DataObject\Data\CalculatedValue('Division');
  451.     $data->setContextualData("object"nullnullnull);
  452.     $object $this;
  453.     $data \Pimcore\Model\DataObject\Service::getCalculatedFieldValue($object$data);
  454.     return $data;
  455. }
  456. /**
  457. * Set Division - Division
  458. * @param \Pimcore\Model\DataObject\Data\CalculatedValue|null $Division
  459. * @return \Pimcore\Model\DataObject\Product
  460. */
  461. public function setDivision($Division)
  462. {
  463.     return $this;
  464. }
  465. /**
  466. * Get ShortDescription - Short Description
  467. * @return string|null
  468. */
  469. public function getShortDescription(): ?string
  470. {
  471.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  472.         $preValue $this->preGetValue("ShortDescription");
  473.         if ($preValue !== null) {
  474.             return $preValue;
  475.         }
  476.     }
  477.     $data $this->getClass()->getFieldDefinition("ShortDescription")->preGetData($this);
  478.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("ShortDescription")->isEmpty($data)) {
  479.         try {
  480.             return $this->getValueFromParent("ShortDescription");
  481.         } catch (InheritanceParentNotFoundException $e) {
  482.             // no data from parent available, continue ...
  483.         }
  484.     }
  485.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  486.         return $data->getPlain();
  487.     }
  488.     return $data;
  489. }
  490. /**
  491. * Set ShortDescription - Short Description
  492. * @param string|null $ShortDescription
  493. * @return \Pimcore\Model\DataObject\Product
  494. */
  495. public function setShortDescription(?string $ShortDescription)
  496. {
  497.     $this->ShortDescription $ShortDescription;
  498.     return $this;
  499. }
  500. /**
  501. * Get Categories - Categories
  502. * @return \Pimcore\Model\DataObject\Category[]
  503. */
  504. public function getCategories(): array
  505. {
  506.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  507.         $preValue $this->preGetValue("Categories");
  508.         if ($preValue !== null) {
  509.             return $preValue;
  510.         }
  511.     }
  512.     $data $this->getClass()->getFieldDefinition("Categories")->preGetData($this);
  513.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Categories")->isEmpty($data)) {
  514.         try {
  515.             return $this->getValueFromParent("Categories");
  516.         } catch (InheritanceParentNotFoundException $e) {
  517.             // no data from parent available, continue ...
  518.         }
  519.     }
  520.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  521.         return $data->getPlain();
  522.     }
  523.     return $data;
  524. }
  525. /**
  526. * Set Categories - Categories
  527. * @param \Pimcore\Model\DataObject\Category[] $Categories
  528. * @return \Pimcore\Model\DataObject\Product
  529. */
  530. public function setCategories(?array $Categories)
  531. {
  532.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  533.     $fd $this->getClass()->getFieldDefinition("Categories");
  534.     $inheritValues self::getGetInheritedValues();
  535.     self::setGetInheritedValues(false);
  536.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  537.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  538.     $currentData $this->getCategories();
  539.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  540.     self::setGetInheritedValues($inheritValues);
  541.     $isEqual $fd->isEqual($currentData$Categories);
  542.     if (!$isEqual) {
  543.         $this->markFieldDirty("Categories"true);
  544.     }
  545.     $this->Categories $fd->preSetData($this$Categories);
  546.     return $this;
  547. }
  548. /**
  549. * Get RelatedProducts - RelatedProducts
  550. * @return \Pimcore\Model\DataObject\Product[]
  551. */
  552. public function getRelatedProducts(): array
  553. {
  554.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  555.         $preValue $this->preGetValue("RelatedProducts");
  556.         if ($preValue !== null) {
  557.             return $preValue;
  558.         }
  559.     }
  560.     $data $this->getClass()->getFieldDefinition("RelatedProducts")->preGetData($this);
  561.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("RelatedProducts")->isEmpty($data)) {
  562.         try {
  563.             return $this->getValueFromParent("RelatedProducts");
  564.         } catch (InheritanceParentNotFoundException $e) {
  565.             // no data from parent available, continue ...
  566.         }
  567.     }
  568.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  569.         return $data->getPlain();
  570.     }
  571.     return $data;
  572. }
  573. /**
  574. * Set RelatedProducts - RelatedProducts
  575. * @param \Pimcore\Model\DataObject\Product[] $RelatedProducts
  576. * @return \Pimcore\Model\DataObject\Product
  577. */
  578. public function setRelatedProducts(?array $RelatedProducts)
  579. {
  580.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  581.     $fd $this->getClass()->getFieldDefinition("RelatedProducts");
  582.     $inheritValues self::getGetInheritedValues();
  583.     self::setGetInheritedValues(false);
  584.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  585.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  586.     $currentData $this->getRelatedProducts();
  587.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  588.     self::setGetInheritedValues($inheritValues);
  589.     $isEqual $fd->isEqual($currentData$RelatedProducts);
  590.     if (!$isEqual) {
  591.         $this->markFieldDirty("RelatedProducts"true);
  592.     }
  593.     $this->RelatedProducts $fd->preSetData($this$RelatedProducts);
  594.     return $this;
  595. }
  596. /**
  597. * Get PurchasedTogether - PurchasedTogether
  598. * @return \Pimcore\Model\DataObject\Product[]
  599. */
  600. public function getPurchasedTogether(): array
  601. {
  602.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  603.         $preValue $this->preGetValue("PurchasedTogether");
  604.         if ($preValue !== null) {
  605.             return $preValue;
  606.         }
  607.     }
  608.     $data $this->getClass()->getFieldDefinition("PurchasedTogether")->preGetData($this);
  609.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("PurchasedTogether")->isEmpty($data)) {
  610.         try {
  611.             return $this->getValueFromParent("PurchasedTogether");
  612.         } catch (InheritanceParentNotFoundException $e) {
  613.             // no data from parent available, continue ...
  614.         }
  615.     }
  616.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  617.         return $data->getPlain();
  618.     }
  619.     return $data;
  620. }
  621. /**
  622. * Set PurchasedTogether - PurchasedTogether
  623. * @param \Pimcore\Model\DataObject\Product[] $PurchasedTogether
  624. * @return \Pimcore\Model\DataObject\Product
  625. */
  626. public function setPurchasedTogether(?array $PurchasedTogether)
  627. {
  628.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  629.     $fd $this->getClass()->getFieldDefinition("PurchasedTogether");
  630.     $inheritValues self::getGetInheritedValues();
  631.     self::setGetInheritedValues(false);
  632.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  633.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  634.     $currentData $this->getPurchasedTogether();
  635.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  636.     self::setGetInheritedValues($inheritValues);
  637.     $isEqual $fd->isEqual($currentData$PurchasedTogether);
  638.     if (!$isEqual) {
  639.         $this->markFieldDirty("PurchasedTogether"true);
  640.     }
  641.     $this->PurchasedTogether $fd->preSetData($this$PurchasedTogether);
  642.     return $this;
  643. }
  644. /**
  645. * Get ReplacementParts - ReplacementParts
  646. * @return \Pimcore\Model\DataObject\Product[]
  647. */
  648. public function getReplacementParts(): array
  649. {
  650.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  651.         $preValue $this->preGetValue("ReplacementParts");
  652.         if ($preValue !== null) {
  653.             return $preValue;
  654.         }
  655.     }
  656.     $data $this->getClass()->getFieldDefinition("ReplacementParts")->preGetData($this);
  657.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("ReplacementParts")->isEmpty($data)) {
  658.         try {
  659.             return $this->getValueFromParent("ReplacementParts");
  660.         } catch (InheritanceParentNotFoundException $e) {
  661.             // no data from parent available, continue ...
  662.         }
  663.     }
  664.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  665.         return $data->getPlain();
  666.     }
  667.     return $data;
  668. }
  669. /**
  670. * Set ReplacementParts - ReplacementParts
  671. * @param \Pimcore\Model\DataObject\Product[] $ReplacementParts
  672. * @return \Pimcore\Model\DataObject\Product
  673. */
  674. public function setReplacementParts(?array $ReplacementParts)
  675. {
  676.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  677.     $fd $this->getClass()->getFieldDefinition("ReplacementParts");
  678.     $inheritValues self::getGetInheritedValues();
  679.     self::setGetInheritedValues(false);
  680.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  681.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  682.     $currentData $this->getReplacementParts();
  683.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  684.     self::setGetInheritedValues($inheritValues);
  685.     $isEqual $fd->isEqual($currentData$ReplacementParts);
  686.     if (!$isEqual) {
  687.         $this->markFieldDirty("ReplacementParts"true);
  688.     }
  689.     $this->ReplacementParts $fd->preSetData($this$ReplacementParts);
  690.     return $this;
  691. }
  692. /**
  693. * Get Products - Products
  694. * @return \Pimcore\Model\DataObject\Product[]
  695. */
  696. public function getProducts(): array
  697. {
  698.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  699.         $preValue $this->preGetValue("Products");
  700.         if ($preValue !== null) {
  701.             return $preValue;
  702.         }
  703.     }
  704.     $data $this->getClass()->getFieldDefinition("Products")->preGetData($this);
  705.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Products")->isEmpty($data)) {
  706.         try {
  707.             return $this->getValueFromParent("Products");
  708.         } catch (InheritanceParentNotFoundException $e) {
  709.             // no data from parent available, continue ...
  710.         }
  711.     }
  712.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  713.         return $data->getPlain();
  714.     }
  715.     return $data;
  716. }
  717. /**
  718. * Set Products - Products
  719. * @param \Pimcore\Model\DataObject\Product[] $Products
  720. * @return \Pimcore\Model\DataObject\Product
  721. */
  722. public function setProducts(?array $Products)
  723. {
  724.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  725.     $fd $this->getClass()->getFieldDefinition("Products");
  726.     $inheritValues self::getGetInheritedValues();
  727.     self::setGetInheritedValues(false);
  728.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  729.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  730.     $currentData $this->getProducts();
  731.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  732.     self::setGetInheritedValues($inheritValues);
  733.     $isEqual $fd->isEqual($currentData$Products);
  734.     if (!$isEqual) {
  735.         $this->markFieldDirty("Products"true);
  736.     }
  737.     $this->Products $fd->preSetData($this$Products);
  738.     return $this;
  739. }
  740. /**
  741. * @return \Pimcore\Model\DataObject\Fieldcollection|null
  742. */
  743. public function getAdditionalContent(): ?\Pimcore\Model\DataObject\Fieldcollection
  744. {
  745.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  746.         $preValue $this->preGetValue("AdditionalContent");
  747.         if ($preValue !== null) {
  748.             return $preValue;
  749.         }
  750.     }
  751.     $data $this->getClass()->getFieldDefinition("AdditionalContent")->preGetData($this);
  752.     return $data;
  753. }
  754. /**
  755. * Set AdditionalContent - AdditionalContent
  756. * @param \Pimcore\Model\DataObject\Fieldcollection|null $AdditionalContent
  757. * @return \Pimcore\Model\DataObject\Product
  758. */
  759. public function setAdditionalContent(?\Pimcore\Model\DataObject\Fieldcollection $AdditionalContent)
  760. {
  761.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Fieldcollections $fd */
  762.     $fd $this->getClass()->getFieldDefinition("AdditionalContent");
  763.     $this->AdditionalContent $fd->preSetData($this$AdditionalContent);
  764.     return $this;
  765. }
  766. /**
  767. * Get Weight - Weight
  768. * @return \Pimcore\Model\DataObject\Data\QuantityValue|null
  769. */
  770. public function getWeight(): ?\Pimcore\Model\DataObject\Data\QuantityValue
  771. {
  772.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  773.         $preValue $this->preGetValue("Weight");
  774.         if ($preValue !== null) {
  775.             return $preValue;
  776.         }
  777.     }
  778.     $data $this->Weight;
  779.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Weight")->isEmpty($data)) {
  780.         try {
  781.             return $this->getValueFromParent("Weight");
  782.         } catch (InheritanceParentNotFoundException $e) {
  783.             // no data from parent available, continue ...
  784.         }
  785.     }
  786.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  787.         return $data->getPlain();
  788.     }
  789.     return $data;
  790. }
  791. /**
  792. * Set Weight - Weight
  793. * @param \Pimcore\Model\DataObject\Data\QuantityValue|null $Weight
  794. * @return \Pimcore\Model\DataObject\Product
  795. */
  796. public function setWeight(?\Pimcore\Model\DataObject\Data\QuantityValue $Weight)
  797. {
  798.     $this->Weight $Weight;
  799.     return $this;
  800. }
  801. /**
  802. * Get Width - Width
  803. * @return \Pimcore\Model\DataObject\Data\QuantityValue|null
  804. */
  805. public function getWidth(): ?\Pimcore\Model\DataObject\Data\QuantityValue
  806. {
  807.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  808.         $preValue $this->preGetValue("Width");
  809.         if ($preValue !== null) {
  810.             return $preValue;
  811.         }
  812.     }
  813.     $data $this->Width;
  814.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Width")->isEmpty($data)) {
  815.         try {
  816.             return $this->getValueFromParent("Width");
  817.         } catch (InheritanceParentNotFoundException $e) {
  818.             // no data from parent available, continue ...
  819.         }
  820.     }
  821.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  822.         return $data->getPlain();
  823.     }
  824.     return $data;
  825. }
  826. /**
  827. * Set Width - Width
  828. * @param \Pimcore\Model\DataObject\Data\QuantityValue|null $Width
  829. * @return \Pimcore\Model\DataObject\Product
  830. */
  831. public function setWidth(?\Pimcore\Model\DataObject\Data\QuantityValue $Width)
  832. {
  833.     $this->Width $Width;
  834.     return $this;
  835. }
  836. /**
  837. * Get Height - Height
  838. * @return \Pimcore\Model\DataObject\Data\QuantityValue|null
  839. */
  840. public function getHeight(): ?\Pimcore\Model\DataObject\Data\QuantityValue
  841. {
  842.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  843.         $preValue $this->preGetValue("Height");
  844.         if ($preValue !== null) {
  845.             return $preValue;
  846.         }
  847.     }
  848.     $data $this->Height;
  849.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Height")->isEmpty($data)) {
  850.         try {
  851.             return $this->getValueFromParent("Height");
  852.         } catch (InheritanceParentNotFoundException $e) {
  853.             // no data from parent available, continue ...
  854.         }
  855.     }
  856.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  857.         return $data->getPlain();
  858.     }
  859.     return $data;
  860. }
  861. /**
  862. * Set Height - Height
  863. * @param \Pimcore\Model\DataObject\Data\QuantityValue|null $Height
  864. * @return \Pimcore\Model\DataObject\Product
  865. */
  866. public function setHeight(?\Pimcore\Model\DataObject\Data\QuantityValue $Height)
  867. {
  868.     $this->Height $Height;
  869.     return $this;
  870. }
  871. /**
  872. * Get Length - Length
  873. * @return \Pimcore\Model\DataObject\Data\QuantityValue|null
  874. */
  875. public function getLength(): ?\Pimcore\Model\DataObject\Data\QuantityValue
  876. {
  877.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  878.         $preValue $this->preGetValue("Length");
  879.         if ($preValue !== null) {
  880.             return $preValue;
  881.         }
  882.     }
  883.     $data $this->Length;
  884.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("Length")->isEmpty($data)) {
  885.         try {
  886.             return $this->getValueFromParent("Length");
  887.         } catch (InheritanceParentNotFoundException $e) {
  888.             // no data from parent available, continue ...
  889.         }
  890.     }
  891.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  892.         return $data->getPlain();
  893.     }
  894.     return $data;
  895. }
  896. /**
  897. * Set Length - Length
  898. * @param \Pimcore\Model\DataObject\Data\QuantityValue|null $Length
  899. * @return \Pimcore\Model\DataObject\Product
  900. */
  901. public function setLength(?\Pimcore\Model\DataObject\Data\QuantityValue $Length)
  902. {
  903.     $this->Length $Length;
  904.     return $this;
  905. }
  906. /**
  907. * Get URLKey - URL Key
  908. * @return string|null
  909. */
  910. public function getURLKey(): ?string
  911. {
  912.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  913.         $preValue $this->preGetValue("URLKey");
  914.         if ($preValue !== null) {
  915.             return $preValue;
  916.         }
  917.     }
  918.     $data $this->URLKey;
  919.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("URLKey")->isEmpty($data)) {
  920.         try {
  921.             return $this->getValueFromParent("URLKey");
  922.         } catch (InheritanceParentNotFoundException $e) {
  923.             // no data from parent available, continue ...
  924.         }
  925.     }
  926.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  927.         return $data->getPlain();
  928.     }
  929.     return $data;
  930. }
  931. /**
  932. * Set URLKey - URL Key
  933. * @param string|null $URLKey
  934. * @return \Pimcore\Model\DataObject\Product
  935. */
  936. public function setURLKey(?string $URLKey)
  937. {
  938.     $this->URLKey $URLKey;
  939.     return $this;
  940. }
  941. /**
  942. * Get URLPath - URL Path
  943. * @return string|null
  944. */
  945. public function getURLPath(): ?string
  946. {
  947.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  948.         $preValue $this->preGetValue("URLPath");
  949.         if ($preValue !== null) {
  950.             return $preValue;
  951.         }
  952.     }
  953.     $data $this->URLPath;
  954.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("URLPath")->isEmpty($data)) {
  955.         try {
  956.             return $this->getValueFromParent("URLPath");
  957.         } catch (InheritanceParentNotFoundException $e) {
  958.             // no data from parent available, continue ...
  959.         }
  960.     }
  961.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  962.         return $data->getPlain();
  963.     }
  964.     return $data;
  965. }
  966. /**
  967. * Set URLPath - URL Path
  968. * @param string|null $URLPath
  969. * @return \Pimcore\Model\DataObject\Product
  970. */
  971. public function setURLPath(?string $URLPath)
  972. {
  973.     $this->URLPath $URLPath;
  974.     return $this;
  975. }
  976. /**
  977. * Get MetaTitle - Meta Title
  978. * @return string|null
  979. */
  980. public function getMetaTitle(): ?string
  981. {
  982.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  983.         $preValue $this->preGetValue("MetaTitle");
  984.         if ($preValue !== null) {
  985.             return $preValue;
  986.         }
  987.     }
  988.     $data $this->MetaTitle;
  989.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("MetaTitle")->isEmpty($data)) {
  990.         try {
  991.             return $this->getValueFromParent("MetaTitle");
  992.         } catch (InheritanceParentNotFoundException $e) {
  993.             // no data from parent available, continue ...
  994.         }
  995.     }
  996.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  997.         return $data->getPlain();
  998.     }
  999.     return $data;
  1000. }
  1001. /**
  1002. * Set MetaTitle - Meta Title
  1003. * @param string|null $MetaTitle
  1004. * @return \Pimcore\Model\DataObject\Product
  1005. */
  1006. public function setMetaTitle(?string $MetaTitle)
  1007. {
  1008.     $this->MetaTitle $MetaTitle;
  1009.     return $this;
  1010. }
  1011. /**
  1012. * Get MetaDescription - Meta Description
  1013. * @return string|null
  1014. */
  1015. public function getMetaDescription(): ?string
  1016. {
  1017.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  1018.         $preValue $this->preGetValue("MetaDescription");
  1019.         if ($preValue !== null) {
  1020.             return $preValue;
  1021.         }
  1022.     }
  1023.     $data $this->MetaDescription;
  1024.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("MetaDescription")->isEmpty($data)) {
  1025.         try {
  1026.             return $this->getValueFromParent("MetaDescription");
  1027.         } catch (InheritanceParentNotFoundException $e) {
  1028.             // no data from parent available, continue ...
  1029.         }
  1030.     }
  1031.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  1032.         return $data->getPlain();
  1033.     }
  1034.     return $data;
  1035. }
  1036. /**
  1037. * Set MetaDescription - Meta Description
  1038. * @param string|null $MetaDescription
  1039. * @return \Pimcore\Model\DataObject\Product
  1040. */
  1041. public function setMetaDescription(?string $MetaDescription)
  1042. {
  1043.     $this->MetaDescription $MetaDescription;
  1044.     return $this;
  1045. }
  1046. /**
  1047. * Get MetaKeywords - Meta Keywords
  1048. * @return string|null
  1049. */
  1050. public function getMetaKeywords(): ?string
  1051. {
  1052.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  1053.         $preValue $this->preGetValue("MetaKeywords");
  1054.         if ($preValue !== null) {
  1055.             return $preValue;
  1056.         }
  1057.     }
  1058.     $data $this->MetaKeywords;
  1059.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("MetaKeywords")->isEmpty($data)) {
  1060.         try {
  1061.             return $this->getValueFromParent("MetaKeywords");
  1062.         } catch (InheritanceParentNotFoundException $e) {
  1063.             // no data from parent available, continue ...
  1064.         }
  1065.     }
  1066.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  1067.         return $data->getPlain();
  1068.     }
  1069.     return $data;
  1070. }
  1071. /**
  1072. * Set MetaKeywords - Meta Keywords
  1073. * @param string|null $MetaKeywords
  1074. * @return \Pimcore\Model\DataObject\Product
  1075. */
  1076. public function setMetaKeywords(?string $MetaKeywords)
  1077. {
  1078.     $this->MetaKeywords $MetaKeywords;
  1079.     return $this;
  1080. }
  1081. /**
  1082. * Get OgImage - OgImage
  1083. * @return \Pimcore\Model\Asset\Image|null
  1084. */
  1085. public function getOgImage(): ?\Pimcore\Model\Asset\Image
  1086. {
  1087.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  1088.         $preValue $this->preGetValue("OgImage");
  1089.         if ($preValue !== null) {
  1090.             return $preValue;
  1091.         }
  1092.     }
  1093.     $data $this->OgImage;
  1094.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("OgImage")->isEmpty($data)) {
  1095.         try {
  1096.             return $this->getValueFromParent("OgImage");
  1097.         } catch (InheritanceParentNotFoundException $e) {
  1098.             // no data from parent available, continue ...
  1099.         }
  1100.     }
  1101.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  1102.         return $data->getPlain();
  1103.     }
  1104.     return $data;
  1105. }
  1106. /**
  1107. * Set OgImage - OgImage
  1108. * @param \Pimcore\Model\Asset\Image|null $OgImage
  1109. * @return \Pimcore\Model\DataObject\Product
  1110. */
  1111. public function setOgImage(?\Pimcore\Model\Asset\Image $OgImage)
  1112. {
  1113.     $this->OgImage $OgImage;
  1114.     return $this;
  1115. }
  1116. /**
  1117. * Get OgTitle - OgTitle
  1118. * @return string|null
  1119. */
  1120. public function getOgTitle(): ?string
  1121. {
  1122.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  1123.         $preValue $this->preGetValue("OgTitle");
  1124.         if ($preValue !== null) {
  1125.             return $preValue;
  1126.         }
  1127.     }
  1128.     $data $this->OgTitle;
  1129.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("OgTitle")->isEmpty($data)) {
  1130.         try {
  1131.             return $this->getValueFromParent("OgTitle");
  1132.         } catch (InheritanceParentNotFoundException $e) {
  1133.             // no data from parent available, continue ...
  1134.         }
  1135.     }
  1136.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  1137.         return $data->getPlain();
  1138.     }
  1139.     return $data;
  1140. }
  1141. /**
  1142. * Set OgTitle - OgTitle
  1143. * @param string|null $OgTitle
  1144. * @return \Pimcore\Model\DataObject\Product
  1145. */
  1146. public function setOgTitle(?string $OgTitle)
  1147. {
  1148.     $this->OgTitle $OgTitle;
  1149.     return $this;
  1150. }
  1151. /**
  1152. * Get OgDescription - OgDescription
  1153. * @return string|null
  1154. */
  1155. public function getOgDescription(): ?string
  1156. {
  1157.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  1158.         $preValue $this->preGetValue("OgDescription");
  1159.         if ($preValue !== null) {
  1160.             return $preValue;
  1161.         }
  1162.     }
  1163.     $data $this->OgDescription;
  1164.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("OgDescription")->isEmpty($data)) {
  1165.         try {
  1166.             return $this->getValueFromParent("OgDescription");
  1167.         } catch (InheritanceParentNotFoundException $e) {
  1168.             // no data from parent available, continue ...
  1169.         }
  1170.     }
  1171.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  1172.         return $data->getPlain();
  1173.     }
  1174.     return $data;
  1175. }
  1176. /**
  1177. * Set OgDescription - OgDescription
  1178. * @param string|null $OgDescription
  1179. * @return \Pimcore\Model\DataObject\Product
  1180. */
  1181. public function setOgDescription(?string $OgDescription)
  1182. {
  1183.     $this->OgDescription $OgDescription;
  1184.     return $this;
  1185. }
  1186. /**
  1187. * Get StockStatus - StockStatus
  1188. * @return string|null
  1189. */
  1190. public function getStockStatus(): ?string
  1191. {
  1192.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  1193.         $preValue $this->preGetValue("StockStatus");
  1194.         if ($preValue !== null) {
  1195.             return $preValue;
  1196.         }
  1197.     }
  1198.     $data $this->StockStatus;
  1199.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("StockStatus")->isEmpty($data)) {
  1200.         try {
  1201.             return $this->getValueFromParent("StockStatus");
  1202.         } catch (InheritanceParentNotFoundException $e) {
  1203.             // no data from parent available, continue ...
  1204.         }
  1205.     }
  1206.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  1207.         return $data->getPlain();
  1208.     }
  1209.     return $data;
  1210. }
  1211. /**
  1212. * Set StockStatus - StockStatus
  1213. * @param string|null $StockStatus
  1214. * @return \Pimcore\Model\DataObject\Product
  1215. */
  1216. public function setStockStatus(?string $StockStatus)
  1217. {
  1218.     $this->StockStatus $StockStatus;
  1219.     return $this;
  1220. }
  1221. }