var/classes/DataObject/Car.php line 577

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