var/classes/DataObject/Car.php line 565

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