var/classes/DataObject/Car.php line 614

Open in your IDE?
  1. <?php
  2. /**
  3. * Inheritance: yes
  4. * Variants: no
  5. Fields Summary:
  6. - localizedfields [localizedfields]
  7. -- name [input]
  8. -- description [wysiwyg]
  9. -- shortDesc [wysiwyg]
  10. -- textsAvailable [calculatedValue]
  11. - series [input]
  12. - manufacturer [manyToOneRelation]
  13. - bodyStyle [manyToOneRelation]
  14. - carClass [select]
  15. - productionYear [numeric]
  16. - color [multiselect]
  17. - country [country]
  18. - categories [manyToManyObjectRelation]
  19. - gallery [imageGallery]
  20. - genericImages [imageGallery]
  21. - attributes [objectbricks]
  22. - saleInformation [objectbricks]
  23. - location [geopoint]
  24. - attributesAvailable [calculatedValue]
  25. - saleInformationAvailable [calculatedValue]
  26. - imagesAvailable [calculatedValue]
  27. - objectType [select]
  28. - urlSlug [urlSlug]
  29. */
  30. namespace Pimcore\Model\DataObject;
  31. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  32. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  33. /**
  34. * @method static \Pimcore\Model\DataObject\Car\Listing getList(array $config = [])
  35. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  36. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  37. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByDescription($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  38. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByShortDesc($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  39. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByTextsAvailable($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  40. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getBySeries($value, $limit = 0, $offset = 0, $objectTypes = null)
  41. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByManufacturer($value, $limit = 0, $offset = 0, $objectTypes = null)
  42. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByBodyStyle($value, $limit = 0, $offset = 0, $objectTypes = null)
  43. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByCarClass($value, $limit = 0, $offset = 0, $objectTypes = null)
  44. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByProductionYear($value, $limit = 0, $offset = 0, $objectTypes = null)
  45. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByColor($value, $limit = 0, $offset = 0, $objectTypes = null)
  46. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByCountry($value, $limit = 0, $offset = 0, $objectTypes = null)
  47. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByCategories($value, $limit = 0, $offset = 0, $objectTypes = null)
  48. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByObjectType($value, $limit = 0, $offset = 0, $objectTypes = null)
  49. * @method static \Pimcore\Model\DataObject\Car\Listing|\Pimcore\Model\DataObject\Car|null getByUrlSlug($value, $limit = 0, $offset = 0, $objectTypes = null)
  50. */
  51. class Car extends \App\Model\Product\AbstractProduct
  52. {
  53. protected $o_classId "CAR";
  54. protected $o_className "Car";
  55. protected $localizedfields;
  56. protected $series;
  57. protected $manufacturer;
  58. protected $bodyStyle;
  59. protected $carClass;
  60. protected $productionYear;
  61. protected $color;
  62. protected $country;
  63. protected $categories;
  64. protected $gallery;
  65. protected $genericImages;
  66. protected $attributes;
  67. protected $saleInformation;
  68. protected $location;
  69. protected $objectType;
  70. protected $urlSlug;
  71. /**
  72. * @param array $values
  73. * @return \Pimcore\Model\DataObject\Car
  74. */
  75. public static function create($values = array()) {
  76.     $object = new static();
  77.     $object->setValues($values);
  78.     return $object;
  79. }
  80. /**
  81. * Get localizedfields - 
  82. * @return \Pimcore\Model\DataObject\Localizedfield|null
  83. */
  84. public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
  85. {
  86.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  87.         $preValue $this->preGetValue("localizedfields");
  88.         if ($preValue !== null) {
  89.             return $preValue;
  90.         }
  91.     }
  92.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  93.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("localizedfields")->isEmpty($data)) {
  94.         try {
  95.             return $this->getValueFromParent("localizedfields");
  96.         } catch (InheritanceParentNotFoundException $e) {
  97.             // no data from parent available, continue ...
  98.         }
  99.     }
  100.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  101.         return $data->getPlain();
  102.     }
  103.     return $data;
  104. }
  105. /**
  106. * Get name - Name
  107. * @return string|null
  108. */
  109. public function getName($language null): ?string
  110. {
  111.     $data $this->getLocalizedfields()->getLocalizedValue("name"$language);
  112.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  113.         $preValue $this->preGetValue("name");
  114.         if ($preValue !== null) {
  115.             return $preValue;
  116.         }
  117.     }
  118.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  119.         return $data->getPlain();
  120.     }
  121.     return $data;
  122. }
  123. /**
  124. * Get description - Description
  125. * @return string|null
  126. */
  127. public function getDescription($language null): ?string
  128. {
  129.     $data $this->getLocalizedfields()->getLocalizedValue("description"$language);
  130.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  131.         $preValue $this->preGetValue("description");
  132.         if ($preValue !== null) {
  133.             return $preValue;
  134.         }
  135.     }
  136.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  137.         return $data->getPlain();
  138.     }
  139.     return $data;
  140. }
  141. /**
  142. * Get shortDesc - Short Desc
  143. * @return string|null
  144. */
  145. public function getShortDesc($language null): ?string
  146. {
  147.     $data $this->getLocalizedfields()->getLocalizedValue("shortDesc"$language);
  148.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  149.         $preValue $this->preGetValue("shortDesc");
  150.         if ($preValue !== null) {
  151.             return $preValue;
  152.         }
  153.     }
  154.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  155.         return $data->getPlain();
  156.     }
  157.     return $data;
  158. }
  159. /**
  160. * Get textsAvailable - Texts Available
  161. * @return \Pimcore\Model\DataObject\Data\CalculatedValue|null
  162. */
  163. public function getTextsAvailable($language null)
  164. {
  165.     if (!$language) {
  166.         try {
  167.             $locale \Pimcore::getContainer()->get("pimcore.locale")->getLocale();
  168.             if (\Pimcore\Tool::isValidLanguage($locale)) {
  169.                 $language = (string) $locale;
  170.             } else {
  171.                 throw new \Exception("Not supported language");
  172.             }
  173.         } catch (\Exception $e) {
  174.             $language \Pimcore\Tool::getDefaultLanguage();
  175.         }
  176.     }
  177.     $object $this;
  178.     $fieldDefinition $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("textsAvailable");
  179.     $data = new \Pimcore\Model\DataObject\Data\CalculatedValue('textsAvailable');
  180.     $data->setContextualData("localizedfield""localizedfields"null$languagenullnull$fieldDefinition);
  181.     $data \Pimcore\Model\DataObject\Service::getCalculatedFieldValue($object$data);
  182.     return $data;
  183. }
  184. /**
  185. * Set localizedfields - 
  186. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  187. * @return \Pimcore\Model\DataObject\Car
  188. */
  189. public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
  190. {
  191.     $inheritValues self::getGetInheritedValues();
  192.     self::setGetInheritedValues(false);
  193.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  194.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  195.     $currentData $this->getLocalizedfields();
  196.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  197.     self::setGetInheritedValues($inheritValues);
  198.     $this->markFieldDirty("localizedfields"true);
  199.     $this->localizedfields $localizedfields;
  200.     return $this;
  201. }
  202. /**
  203. * Set name - Name
  204. * @param string|null $name
  205. * @return \Pimcore\Model\DataObject\Car
  206. */
  207. public function setName (?string $name$language null)
  208. {
  209.     $isEqual false;
  210.     $this->getLocalizedfields()->setLocalizedValue("name"$name$language, !$isEqual);
  211.     return $this;
  212. }
  213. /**
  214. * Set description - Description
  215. * @param string|null $description
  216. * @return \Pimcore\Model\DataObject\Car
  217. */
  218. public function setDescription (?string $description$language null)
  219. {
  220.     $isEqual false;
  221.     $this->getLocalizedfields()->setLocalizedValue("description"$description$language, !$isEqual);
  222.     return $this;
  223. }
  224. /**
  225. * Set shortDesc - Short Desc
  226. * @param string|null $shortDesc
  227. * @return \Pimcore\Model\DataObject\Car
  228. */
  229. public function setShortDesc (?string $shortDesc$language null)
  230. {
  231.     $isEqual false;
  232.     $this->getLocalizedfields()->setLocalizedValue("shortDesc"$shortDesc$language, !$isEqual);
  233.     return $this;
  234. }
  235. /**
  236. * Set textsAvailable - Texts Available
  237. * @param \Pimcore\Model\DataObject\Data\CalculatedValue|null $textsAvailable
  238. * @return \Pimcore\Model\DataObject\Car
  239. */
  240. public function setTextsAvailable($textsAvailable$language null)
  241. {
  242.     return $this;
  243. }
  244. /**
  245. * Get series - Series
  246. * @return string|null
  247. */
  248. public function getSeries(): ?string
  249. {
  250.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  251.         $preValue $this->preGetValue("series");
  252.         if ($preValue !== null) {
  253.             return $preValue;
  254.         }
  255.     }
  256.     $data $this->series;
  257.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("series")->isEmpty($data)) {
  258.         try {
  259.             return $this->getValueFromParent("series");
  260.         } catch (InheritanceParentNotFoundException $e) {
  261.             // no data from parent available, continue ...
  262.         }
  263.     }
  264.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  265.         return $data->getPlain();
  266.     }
  267.     return $data;
  268. }
  269. /**
  270. * Set series - Series
  271. * @param string|null $series
  272. * @return \Pimcore\Model\DataObject\Car
  273. */
  274. public function setSeries(?string $series)
  275. {
  276.     $this->series $series;
  277.     return $this;
  278. }
  279. /**
  280. * Get manufacturer - Manufacturer
  281. * @return \Pimcore\Model\DataObject\Manufacturer|null
  282. */
  283. public function getManufacturer(): ?\Pimcore\Model\Element\AbstractElement
  284. {
  285.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  286.         $preValue $this->preGetValue("manufacturer");
  287.         if ($preValue !== null) {
  288.             return $preValue;
  289.         }
  290.     }
  291.     $data $this->getClass()->getFieldDefinition("manufacturer")->preGetData($this);
  292.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("manufacturer")->isEmpty($data)) {
  293.         try {
  294.             return $this->getValueFromParent("manufacturer");
  295.         } catch (InheritanceParentNotFoundException $e) {
  296.             // no data from parent available, continue ...
  297.         }
  298.     }
  299.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  300.         return $data->getPlain();
  301.     }
  302.     return $data;
  303. }
  304. /**
  305. * Set manufacturer - Manufacturer
  306. * @param \Pimcore\Model\DataObject\Manufacturer $manufacturer
  307. * @return \Pimcore\Model\DataObject\Car
  308. */
  309. public function setManufacturer(?\Pimcore\Model\Element\AbstractElement $manufacturer)
  310. {
  311.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  312.     $fd $this->getClass()->getFieldDefinition("manufacturer");
  313.     $inheritValues self::getGetInheritedValues();
  314.     self::setGetInheritedValues(false);
  315.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  316.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  317.     $currentData $this->getManufacturer();
  318.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  319.     self::setGetInheritedValues($inheritValues);
  320.     $isEqual $fd->isEqual($currentData$manufacturer);
  321.     if (!$isEqual) {
  322.         $this->markFieldDirty("manufacturer"true);
  323.     }
  324.     $this->manufacturer $fd->preSetData($this$manufacturer);
  325.     return $this;
  326. }
  327. /**
  328. * Get bodyStyle - Body Style
  329. * @return \Pimcore\Model\DataObject\BodyStyle|null
  330. */
  331. public function getBodyStyle(): ?\Pimcore\Model\Element\AbstractElement
  332. {
  333.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  334.         $preValue $this->preGetValue("bodyStyle");
  335.         if ($preValue !== null) {
  336.             return $preValue;
  337.         }
  338.     }
  339.     $data $this->getClass()->getFieldDefinition("bodyStyle")->preGetData($this);
  340.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("bodyStyle")->isEmpty($data)) {
  341.         try {
  342.             return $this->getValueFromParent("bodyStyle");
  343.         } catch (InheritanceParentNotFoundException $e) {
  344.             // no data from parent available, continue ...
  345.         }
  346.     }
  347.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  348.         return $data->getPlain();
  349.     }
  350.     return $data;
  351. }
  352. /**
  353. * Set bodyStyle - Body Style
  354. * @param \Pimcore\Model\DataObject\BodyStyle $bodyStyle
  355. * @return \Pimcore\Model\DataObject\Car
  356. */
  357. public function setBodyStyle(?\Pimcore\Model\Element\AbstractElement $bodyStyle)
  358. {
  359.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  360.     $fd $this->getClass()->getFieldDefinition("bodyStyle");
  361.     $inheritValues self::getGetInheritedValues();
  362.     self::setGetInheritedValues(false);
  363.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  364.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  365.     $currentData $this->getBodyStyle();
  366.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  367.     self::setGetInheritedValues($inheritValues);
  368.     $isEqual $fd->isEqual($currentData$bodyStyle);
  369.     if (!$isEqual) {
  370.         $this->markFieldDirty("bodyStyle"true);
  371.     }
  372.     $this->bodyStyle $fd->preSetData($this$bodyStyle);
  373.     return $this;
  374. }
  375. /**
  376. * Get carClass - Class
  377. * @return string|null
  378. */
  379. public function getCarClass(): ?string
  380. {
  381.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  382.         $preValue $this->preGetValue("carClass");
  383.         if ($preValue !== null) {
  384.             return $preValue;
  385.         }
  386.     }
  387.     $data $this->carClass;
  388.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("carClass")->isEmpty($data)) {
  389.         try {
  390.             return $this->getValueFromParent("carClass");
  391.         } catch (InheritanceParentNotFoundException $e) {
  392.             // no data from parent available, continue ...
  393.         }
  394.     }
  395.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  396.         return $data->getPlain();
  397.     }
  398.     return $data;
  399. }
  400. /**
  401. * Set carClass - Class
  402. * @param string|null $carClass
  403. * @return \Pimcore\Model\DataObject\Car
  404. */
  405. public function setCarClass(?string $carClass)
  406. {
  407.     $this->carClass $carClass;
  408.     return $this;
  409. }
  410. /**
  411. * Get productionYear - Production Year
  412. * @return int|null
  413. */
  414. public function getProductionYear(): ?int
  415. {
  416.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  417.         $preValue $this->preGetValue("productionYear");
  418.         if ($preValue !== null) {
  419.             return $preValue;
  420.         }
  421.     }
  422.     $data $this->productionYear;
  423.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("productionYear")->isEmpty($data)) {
  424.         try {
  425.             return $this->getValueFromParent("productionYear");
  426.         } catch (InheritanceParentNotFoundException $e) {
  427.             // no data from parent available, continue ...
  428.         }
  429.     }
  430.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  431.         return $data->getPlain();
  432.     }
  433.     return $data;
  434. }
  435. /**
  436. * Set productionYear - Production Year
  437. * @param int|null $productionYear
  438. * @return \Pimcore\Model\DataObject\Car
  439. */
  440. public function setProductionYear(?int $productionYear)
  441. {
  442.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  443.     $fd $this->getClass()->getFieldDefinition("productionYear");
  444.     $this->productionYear $fd->preSetData($this$productionYear);
  445.     return $this;
  446. }
  447. /**
  448. * Get color - Color
  449. * @return string[]|null
  450. */
  451. public function getColor(): ?array
  452. {
  453.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  454.         $preValue $this->preGetValue("color");
  455.         if ($preValue !== null) {
  456.             return $preValue;
  457.         }
  458.     }
  459.     $data $this->color;
  460.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("color")->isEmpty($data)) {
  461.         try {
  462.             return $this->getValueFromParent("color");
  463.         } catch (InheritanceParentNotFoundException $e) {
  464.             // no data from parent available, continue ...
  465.         }
  466.     }
  467.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  468.         return $data->getPlain();
  469.     }
  470.     return $data;
  471. }
  472. /**
  473. * Set color - Color
  474. * @param string[]|null $color
  475. * @return \Pimcore\Model\DataObject\Car
  476. */
  477. public function setColor(?array $color)
  478. {
  479.     $this->color $color;
  480.     return $this;
  481. }
  482. /**
  483. * Get country - Country
  484. * @return string|null
  485. */
  486. public function getCountry(): ?string
  487. {
  488.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  489.         $preValue $this->preGetValue("country");
  490.         if ($preValue !== null) {
  491.             return $preValue;
  492.         }
  493.     }
  494.     $data $this->country;
  495.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("country")->isEmpty($data)) {
  496.         try {
  497.             return $this->getValueFromParent("country");
  498.         } catch (InheritanceParentNotFoundException $e) {
  499.             // no data from parent available, continue ...
  500.         }
  501.     }
  502.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  503.         return $data->getPlain();
  504.     }
  505.     return $data;
  506. }
  507. /**
  508. * Set country - Country
  509. * @param string|null $country
  510. * @return \Pimcore\Model\DataObject\Car
  511. */
  512. public function setCountry(?string $country)
  513. {
  514.     $this->country $country;
  515.     return $this;
  516. }
  517. /**
  518. * Get categories - Categories
  519. * @return \Pimcore\Model\DataObject\Category[]
  520. */
  521. public function getCategories(): array
  522. {
  523.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  524.         $preValue $this->preGetValue("categories");
  525.         if ($preValue !== null) {
  526.             return $preValue;
  527.         }
  528.     }
  529.     $data $this->getClass()->getFieldDefinition("categories")->preGetData($this);
  530.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("categories")->isEmpty($data)) {
  531.         try {
  532.             return $this->getValueFromParent("categories");
  533.         } catch (InheritanceParentNotFoundException $e) {
  534.             // no data from parent available, continue ...
  535.         }
  536.     }
  537.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  538.         return $data->getPlain();
  539.     }
  540.     return $data;
  541. }
  542. /**
  543. * Set categories - Categories
  544. * @param \Pimcore\Model\DataObject\Category[] $categories
  545. * @return \Pimcore\Model\DataObject\Car
  546. */
  547. public function setCategories(?array $categories)
  548. {
  549.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  550.     $fd $this->getClass()->getFieldDefinition("categories");
  551.     $inheritValues self::getGetInheritedValues();
  552.     self::setGetInheritedValues(false);
  553.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  554.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  555.     $currentData $this->getCategories();
  556.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  557.     self::setGetInheritedValues($inheritValues);
  558.     $isEqual $fd->isEqual($currentData$categories);
  559.     if (!$isEqual) {
  560.         $this->markFieldDirty("categories"true);
  561.     }
  562.     $this->categories $fd->preSetData($this$categories);
  563.     return $this;
  564. }
  565. /**
  566. * Get gallery - Gallery
  567. * @return \Pimcore\Model\DataObject\Data\ImageGallery|null
  568. */
  569. public function getGallery(): ?\Pimcore\Model\DataObject\Data\ImageGallery
  570. {
  571.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  572.         $preValue $this->preGetValue("gallery");
  573.         if ($preValue !== null) {
  574.             return $preValue;
  575.         }
  576.     }
  577.     $data $this->gallery;
  578.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("gallery")->isEmpty($data)) {
  579.         try {
  580.             return $this->getValueFromParent("gallery");
  581.         } catch (InheritanceParentNotFoundException $e) {
  582.             // no data from parent available, continue ...
  583.         }
  584.     }
  585.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  586.         return $data->getPlain();
  587.     }
  588.     return $data;
  589. }
  590. /**
  591. * Set gallery - Gallery
  592. * @param \Pimcore\Model\DataObject\Data\ImageGallery|null $gallery
  593. * @return \Pimcore\Model\DataObject\Car
  594. */
  595. public function setGallery(?\Pimcore\Model\DataObject\Data\ImageGallery $gallery)
  596. {
  597.     $this->gallery $gallery;
  598.     return $this;
  599. }
  600. /**
  601. * Get genericImages - Generic Images
  602. * @return \Pimcore\Model\DataObject\Data\ImageGallery|null
  603. */
  604. public function getGenericImages(): ?\Pimcore\Model\DataObject\Data\ImageGallery
  605. {
  606.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  607.         $preValue $this->preGetValue("genericImages");
  608.         if ($preValue !== null) {
  609.             return $preValue;
  610.         }
  611.     }
  612.     $data $this->genericImages;
  613.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("genericImages")->isEmpty($data)) {
  614.         try {
  615.             return $this->getValueFromParent("genericImages");
  616.         } catch (InheritanceParentNotFoundException $e) {
  617.             // no data from parent available, continue ...
  618.         }
  619.     }
  620.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  621.         return $data->getPlain();
  622.     }
  623.     return $data;
  624. }
  625. /**
  626. * Set genericImages - Generic Images
  627. * @param \Pimcore\Model\DataObject\Data\ImageGallery|null $genericImages
  628. * @return \Pimcore\Model\DataObject\Car
  629. */
  630. public function setGenericImages(?\Pimcore\Model\DataObject\Data\ImageGallery $genericImages)
  631. {
  632.     $this->genericImages $genericImages;
  633.     return $this;
  634. }
  635. /**
  636. * @return \Pimcore\Model\DataObject\Car\Attributes
  637. */
  638. public function getAttributes(): ?\Pimcore\Model\DataObject\Objectbrick
  639. {
  640.     $data $this->attributes;
  641.     if (!$data) {
  642.         if (\Pimcore\Tool::classExists("\\Pimcore\\Model\\DataObject\\Car\\Attributes")) {
  643.             $data = new \Pimcore\Model\DataObject\Car\Attributes($this"attributes");
  644.             $this->attributes $data;
  645.         } else {
  646.             return null;
  647.         }
  648.     }
  649.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  650.         $preValue $this->preGetValue("attributes");
  651.         if ($preValue !== null) {
  652.             return $preValue;
  653.         }
  654.     }
  655.     return $data;
  656. }
  657. /**
  658. * Set attributes - Attributes
  659. * @param \Pimcore\Model\DataObject\Objectbrick|null $attributes
  660. * @return \Pimcore\Model\DataObject\Car
  661. */
  662. public function setAttributes(?\Pimcore\Model\DataObject\Objectbrick $attributes)
  663. {
  664.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Objectbricks $fd */
  665.     $fd $this->getClass()->getFieldDefinition("attributes");
  666.     $this->attributes $fd->preSetData($this$attributes);
  667.     return $this;
  668. }
  669. /**
  670. * @return \Pimcore\Model\DataObject\Car\SaleInformation
  671. */
  672. public function getSaleInformation(): ?\Pimcore\Model\DataObject\Objectbrick
  673. {
  674.     $data $this->saleInformation;
  675.     if (!$data) {
  676.         if (\Pimcore\Tool::classExists("\\Pimcore\\Model\\DataObject\\Car\\SaleInformation")) {
  677.             $data = new \Pimcore\Model\DataObject\Car\SaleInformation($this"saleInformation");
  678.             $this->saleInformation $data;
  679.         } else {
  680.             return null;
  681.         }
  682.     }
  683.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  684.         $preValue $this->preGetValue("saleInformation");
  685.         if ($preValue !== null) {
  686.             return $preValue;
  687.         }
  688.     }
  689.     return $data;
  690. }
  691. /**
  692. * Set saleInformation - Sale Information
  693. * @param \Pimcore\Model\DataObject\Objectbrick|null $saleInformation
  694. * @return \Pimcore\Model\DataObject\Car
  695. */
  696. public function setSaleInformation(?\Pimcore\Model\DataObject\Objectbrick $saleInformation)
  697. {
  698.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Objectbricks $fd */
  699.     $fd $this->getClass()->getFieldDefinition("saleInformation");
  700.     $this->saleInformation $fd->preSetData($this$saleInformation);
  701.     return $this;
  702. }
  703. /**
  704. * Get location - Location
  705. * @return \Pimcore\Model\DataObject\Data\GeoCoordinates|null
  706. */
  707. public function getLocation(): ?\Pimcore\Model\DataObject\Data\GeoCoordinates
  708. {
  709.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  710.         $preValue $this->preGetValue("location");
  711.         if ($preValue !== null) {
  712.             return $preValue;
  713.         }
  714.     }
  715.     $data $this->location;
  716.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("location")->isEmpty($data)) {
  717.         try {
  718.             return $this->getValueFromParent("location");
  719.         } catch (InheritanceParentNotFoundException $e) {
  720.             // no data from parent available, continue ...
  721.         }
  722.     }
  723.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  724.         return $data->getPlain();
  725.     }
  726.     return $data;
  727. }
  728. /**
  729. * Set location - Location
  730. * @param \Pimcore\Model\DataObject\Data\GeoCoordinates|null $location
  731. * @return \Pimcore\Model\DataObject\Car
  732. */
  733. public function setLocation(?\Pimcore\Model\DataObject\Data\GeoCoordinates $location)
  734. {
  735.     $this->location $location;
  736.     return $this;
  737. }
  738. /**
  739. * Get attributesAvailable - Attributes Available
  740. * @return \Pimcore\Model\DataObject\Data\CalculatedValue|null
  741. */
  742. public function getAttributesAvailable()
  743. {
  744.     $data = new \Pimcore\Model\DataObject\Data\CalculatedValue('attributesAvailable');
  745.     $data->setContextualData("object"nullnullnull);
  746.     $object $this;
  747.     $data \Pimcore\Model\DataObject\Service::getCalculatedFieldValue($object$data);
  748.     return $data;
  749. }
  750. /**
  751. * Set attributesAvailable - Attributes Available
  752. * @param \Pimcore\Model\DataObject\Data\CalculatedValue|null $attributesAvailable
  753. * @return \Pimcore\Model\DataObject\Car
  754. */
  755. public function setAttributesAvailable($attributesAvailable)
  756. {
  757.     return $this;
  758. }
  759. /**
  760. * Get saleInformationAvailable - Sale Information Available
  761. * @return \Pimcore\Model\DataObject\Data\CalculatedValue|null
  762. */
  763. public function getSaleInformationAvailable()
  764. {
  765.     $data = new \Pimcore\Model\DataObject\Data\CalculatedValue('saleInformationAvailable');
  766.     $data->setContextualData("object"nullnullnull);
  767.     $object $this;
  768.     $data \Pimcore\Model\DataObject\Service::getCalculatedFieldValue($object$data);
  769.     return $data;
  770. }
  771. /**
  772. * Set saleInformationAvailable - Sale Information Available
  773. * @param \Pimcore\Model\DataObject\Data\CalculatedValue|null $saleInformationAvailable
  774. * @return \Pimcore\Model\DataObject\Car
  775. */
  776. public function setSaleInformationAvailable($saleInformationAvailable)
  777. {
  778.     return $this;
  779. }
  780. /**
  781. * Get imagesAvailable - Images Available
  782. * @return \Pimcore\Model\DataObject\Data\CalculatedValue|null
  783. */
  784. public function getImagesAvailable()
  785. {
  786.     $data = new \Pimcore\Model\DataObject\Data\CalculatedValue('imagesAvailable');
  787.     $data->setContextualData("object"nullnullnull);
  788.     $object $this;
  789.     $data \Pimcore\Model\DataObject\Service::getCalculatedFieldValue($object$data);
  790.     return $data;
  791. }
  792. /**
  793. * Set imagesAvailable - Images Available
  794. * @param \Pimcore\Model\DataObject\Data\CalculatedValue|null $imagesAvailable
  795. * @return \Pimcore\Model\DataObject\Car
  796. */
  797. public function setImagesAvailable($imagesAvailable)
  798. {
  799.     return $this;
  800. }
  801. /**
  802. * Get objectType - Object Type
  803. * @return string|null
  804. */
  805. public function getObjectType(): ?string
  806. {
  807.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  808.         $preValue $this->preGetValue("objectType");
  809.         if ($preValue !== null) {
  810.             return $preValue;
  811.         }
  812.     }
  813.     $data $this->objectType;
  814.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("objectType")->isEmpty($data)) {
  815.         try {
  816.             return $this->getValueFromParent("objectType");
  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 objectType - Object Type
  828. * @param string|null $objectType
  829. * @return \Pimcore\Model\DataObject\Car
  830. */
  831. public function setObjectType(?string $objectType)
  832. {
  833.     $this->objectType $objectType;
  834.     return $this;
  835. }
  836. /**
  837. * Get urlSlug - UrlSlug
  838. * @return \Pimcore\Model\DataObject\Data\UrlSlug[]
  839. */
  840. public function getUrlSlug(): ?array
  841. {
  842.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  843.         $preValue $this->preGetValue("urlSlug");
  844.         if ($preValue !== null) {
  845.             return $preValue;
  846.         }
  847.     }
  848.     $data $this->getClass()->getFieldDefinition("urlSlug")->preGetData($this);
  849.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  850.         return $data->getPlain();
  851.     }
  852.     return $data;
  853. }
  854. /**
  855. * Set urlSlug - UrlSlug
  856. * @param \Pimcore\Model\DataObject\Data\UrlSlug[] $urlSlug
  857. * @return \Pimcore\Model\DataObject\Car
  858. */
  859. public function setUrlSlug(?array $urlSlug)
  860. {
  861.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\UrlSlug $fd */
  862.     $fd $this->getClass()->getFieldDefinition("urlSlug");
  863.     $inheritValues self::getGetInheritedValues();
  864.     self::setGetInheritedValues(false);
  865.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  866.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  867.     $currentData $this->getUrlSlug();
  868.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  869.     self::setGetInheritedValues($inheritValues);
  870.     $isEqual $fd->isEqual($currentData$urlSlug);
  871.     if (!$isEqual) {
  872.         $this->markFieldDirty("urlSlug"true);
  873.     }
  874.     $this->urlSlug $fd->preSetData($this$urlSlug);
  875.     return $this;
  876. }
  877. }