var/classes/DataObject/AccessoryPart.php line 283

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - localizedfields [localizedfields]
  8.  * -- generatedName [calculatedValue]
  9.  * -- nameAddition [input]
  10.  * - manufacturer [manyToOneRelation]
  11.  * - series [manyToOneRelation]
  12.  * - mainCategory [manyToOneRelation]
  13.  * - compatibleTo [manyToManyObjectRelation]
  14.  * - technicalAttributes [classificationstore]
  15.  * - image [hotspotimage]
  16.  * - additionalCategories [manyToManyObjectRelation]
  17.  * - erpNumber [input]
  18.  * - categoryCode [input]
  19.  * - owner [input]
  20.  * - saleInformation [objectbricks]
  21.  * - urlSlug [urlSlug]
  22.  */
  23. namespace Pimcore\Model\DataObject;
  24. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  25. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  26. /**
  27. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing getList(array $config = [])
  28. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByGeneratedName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByNameAddition($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByManufacturer($value, $limit = 0, $offset = 0, $objectTypes = null)
  32. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getBySeries($value, $limit = 0, $offset = 0, $objectTypes = null)
  33. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByMainCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
  34. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByCompatibleTo($value, $limit = 0, $offset = 0, $objectTypes = null)
  35. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByAdditionalCategories($value, $limit = 0, $offset = 0, $objectTypes = null)
  36. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByErpNumber($value, $limit = 0, $offset = 0, $objectTypes = null)
  37. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByCategoryCode($value, $limit = 0, $offset = 0, $objectTypes = null)
  38. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByOwner($value, $limit = 0, $offset = 0, $objectTypes = null)
  39. * @method static \Pimcore\Model\DataObject\AccessoryPart\Listing|\Pimcore\Model\DataObject\AccessoryPart|null getByUrlSlug($value, $limit = 0, $offset = 0, $objectTypes = null)
  40. */
  41. class AccessoryPart extends \App\Model\Product\AbstractProduct
  42. {
  43. protected $o_classId "AP";
  44. protected $o_className "AccessoryPart";
  45. protected $localizedfields;
  46. protected $manufacturer;
  47. protected $series;
  48. protected $mainCategory;
  49. protected $compatibleTo;
  50. protected $technicalAttributes;
  51. protected $image;
  52. protected $additionalCategories;
  53. protected $erpNumber;
  54. protected $categoryCode;
  55. protected $owner;
  56. protected $saleInformation;
  57. protected $urlSlug;
  58. /**
  59. * @param array $values
  60. * @return \Pimcore\Model\DataObject\AccessoryPart
  61. */
  62. public static function create($values = array()) {
  63.     $object = new static();
  64.     $object->setValues($values);
  65.     return $object;
  66. }
  67. /**
  68. * Get localizedfields - 
  69. * @return \Pimcore\Model\DataObject\Localizedfield|null
  70. */
  71. public function getLocalizedfields(): ?\Pimcore\Model\DataObject\Localizedfield
  72. {
  73.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  74.         $preValue $this->preGetValue("localizedfields");
  75.         if ($preValue !== null) {
  76.             return $preValue;
  77.         }
  78.     }
  79.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  80.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  81.         return $data->getPlain();
  82.     }
  83.     return $data;
  84. }
  85. /**
  86. * Get generatedName - Fullname
  87. * @return \Pimcore\Model\DataObject\Data\CalculatedValue|null
  88. */
  89. public function getGeneratedName($language null)
  90. {
  91.     if (!$language) {
  92.         try {
  93.             $locale \Pimcore::getContainer()->get("pimcore.locale")->getLocale();
  94.             if (\Pimcore\Tool::isValidLanguage($locale)) {
  95.                 $language = (string) $locale;
  96.             } else {
  97.                 throw new \Exception("Not supported language");
  98.             }
  99.         } catch (\Exception $e) {
  100.             $language \Pimcore\Tool::getDefaultLanguage();
  101.         }
  102.     }
  103.     $object $this;
  104.     $fieldDefinition $this->getClass()->getFieldDefinition("localizedfields")->getFieldDefinition("generatedName");
  105.     $data = new \Pimcore\Model\DataObject\Data\CalculatedValue('generatedName');
  106.     $data->setContextualData("localizedfield""localizedfields"null$languagenullnull$fieldDefinition);
  107.     $data \Pimcore\Model\DataObject\Service::getCalculatedFieldValue($object$data);
  108.     return $data;
  109. }
  110. /**
  111. * Get nameAddition - Name Addition
  112. * @return string|null
  113. */
  114. public function getNameAddition($language null): ?string
  115. {
  116.     $data $this->getLocalizedfields()->getLocalizedValue("nameAddition"$language);
  117.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  118.         $preValue $this->preGetValue("nameAddition");
  119.         if ($preValue !== null) {
  120.             return $preValue;
  121.         }
  122.     }
  123.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  124.         return $data->getPlain();
  125.     }
  126.     return $data;
  127. }
  128. /**
  129. * Set localizedfields - 
  130. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  131. * @return \Pimcore\Model\DataObject\AccessoryPart
  132. */
  133. public function setLocalizedfields(?\Pimcore\Model\DataObject\Localizedfield $localizedfields)
  134. {
  135.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  136.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  137.     $currentData $this->getLocalizedfields();
  138.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  139.     $this->markFieldDirty("localizedfields"true);
  140.     $this->localizedfields $localizedfields;
  141.     return $this;
  142. }
  143. /**
  144. * Set generatedName - Fullname
  145. * @param \Pimcore\Model\DataObject\Data\CalculatedValue|null $generatedName
  146. * @return \Pimcore\Model\DataObject\AccessoryPart
  147. */
  148. public function setGeneratedName($generatedName$language null)
  149. {
  150.     return $this;
  151. }
  152. /**
  153. * Set nameAddition - Name Addition
  154. * @param string|null $nameAddition
  155. * @return \Pimcore\Model\DataObject\AccessoryPart
  156. */
  157. public function setNameAddition (?string $nameAddition$language null)
  158. {
  159.     $isEqual false;
  160.     $this->getLocalizedfields()->setLocalizedValue("nameAddition"$nameAddition$language, !$isEqual);
  161.     return $this;
  162. }
  163. /**
  164. * Get manufacturer - Manufacturer
  165. * @return \Pimcore\Model\DataObject\Manufacturer|null
  166. */
  167. public function getManufacturer(): ?\Pimcore\Model\Element\AbstractElement
  168. {
  169.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  170.         $preValue $this->preGetValue("manufacturer");
  171.         if ($preValue !== null) {
  172.             return $preValue;
  173.         }
  174.     }
  175.     $data $this->getClass()->getFieldDefinition("manufacturer")->preGetData($this);
  176.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  177.         return $data->getPlain();
  178.     }
  179.     return $data;
  180. }
  181. /**
  182. * Set manufacturer - Manufacturer
  183. * @param \Pimcore\Model\DataObject\Manufacturer|null $manufacturer
  184. * @return \Pimcore\Model\DataObject\AccessoryPart
  185. */
  186. public function setManufacturer(?\Pimcore\Model\Element\AbstractElement $manufacturer)
  187. {
  188.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  189.     $fd $this->getClass()->getFieldDefinition("manufacturer");
  190.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  191.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  192.     $currentData $this->getManufacturer();
  193.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  194.     $isEqual $fd->isEqual($currentData$manufacturer);
  195.     if (!$isEqual) {
  196.         $this->markFieldDirty("manufacturer"true);
  197.     }
  198.     $this->manufacturer $fd->preSetData($this$manufacturer);
  199.     return $this;
  200. }
  201. /**
  202. * Get series - Series
  203. * @return \Pimcore\Model\DataObject\Car|null
  204. */
  205. public function getSeries(): ?\Pimcore\Model\Element\AbstractElement
  206. {
  207.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  208.         $preValue $this->preGetValue("series");
  209.         if ($preValue !== null) {
  210.             return $preValue;
  211.         }
  212.     }
  213.     $data $this->getClass()->getFieldDefinition("series")->preGetData($this);
  214.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  215.         return $data->getPlain();
  216.     }
  217.     return $data;
  218. }
  219. /**
  220. * Set series - Series
  221. * @param \Pimcore\Model\DataObject\Car|null $series
  222. * @return \Pimcore\Model\DataObject\AccessoryPart
  223. */
  224. public function setSeries(?\Pimcore\Model\Element\AbstractElement $series)
  225. {
  226.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  227.     $fd $this->getClass()->getFieldDefinition("series");
  228.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  229.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  230.     $currentData $this->getSeries();
  231.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  232.     $isEqual $fd->isEqual($currentData$series);
  233.     if (!$isEqual) {
  234.         $this->markFieldDirty("series"true);
  235.     }
  236.     $this->series $fd->preSetData($this$series);
  237.     return $this;
  238. }
  239. /**
  240. * Get mainCategory - Main Category
  241. * @return \Pimcore\Model\DataObject\Category|null
  242. */
  243. public function getMainCategory(): ?\Pimcore\Model\Element\AbstractElement
  244. {
  245.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  246.         $preValue $this->preGetValue("mainCategory");
  247.         if ($preValue !== null) {
  248.             return $preValue;
  249.         }
  250.     }
  251.     $data $this->getClass()->getFieldDefinition("mainCategory")->preGetData($this);
  252.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  253.         return $data->getPlain();
  254.     }
  255.     return $data;
  256. }
  257. /**
  258. * Set mainCategory - Main Category
  259. * @param \Pimcore\Model\DataObject\Category|null $mainCategory
  260. * @return \Pimcore\Model\DataObject\AccessoryPart
  261. */
  262. public function setMainCategory(?\Pimcore\Model\Element\AbstractElement $mainCategory)
  263. {
  264.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  265.     $fd $this->getClass()->getFieldDefinition("mainCategory");
  266.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  267.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  268.     $currentData $this->getMainCategory();
  269.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  270.     $isEqual $fd->isEqual($currentData$mainCategory);
  271.     if (!$isEqual) {
  272.         $this->markFieldDirty("mainCategory"true);
  273.     }
  274.     $this->mainCategory $fd->preSetData($this$mainCategory);
  275.     return $this;
  276. }
  277. /**
  278. * Get compatibleTo - Compatible To
  279. * @return \Pimcore\Model\DataObject\Car[]
  280. */
  281. public function getCompatibleTo(): array
  282. {
  283.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  284.         $preValue $this->preGetValue("compatibleTo");
  285.         if ($preValue !== null) {
  286.             return $preValue;
  287.         }
  288.     }
  289.     $data $this->getClass()->getFieldDefinition("compatibleTo")->preGetData($this);
  290.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  291.         return $data->getPlain();
  292.     }
  293.     return $data;
  294. }
  295. /**
  296. * Set compatibleTo - Compatible To
  297. * @param \Pimcore\Model\DataObject\Car[] $compatibleTo
  298. * @return \Pimcore\Model\DataObject\AccessoryPart
  299. */
  300. public function setCompatibleTo(?array $compatibleTo)
  301. {
  302.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  303.     $fd $this->getClass()->getFieldDefinition("compatibleTo");
  304.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  305.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  306.     $currentData $this->getCompatibleTo();
  307.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  308.     $isEqual $fd->isEqual($currentData$compatibleTo);
  309.     if (!$isEqual) {
  310.         $this->markFieldDirty("compatibleTo"true);
  311.     }
  312.     $this->compatibleTo $fd->preSetData($this$compatibleTo);
  313.     return $this;
  314. }
  315. /**
  316. * Get technicalAttributes - Technical Attributes
  317. * @return \Pimcore\Model\DataObject\Classificationstore|null
  318. */
  319. public function getTechnicalAttributes(): ?\Pimcore\Model\DataObject\Classificationstore
  320. {
  321.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  322.         $preValue $this->preGetValue("technicalAttributes");
  323.         if ($preValue !== null) {
  324.             return $preValue;
  325.         }
  326.     }
  327.     $data $this->getClass()->getFieldDefinition("technicalAttributes")->preGetData($this);
  328.     return $data;
  329. }
  330. /**
  331. * Set technicalAttributes - Technical Attributes
  332. * @param \Pimcore\Model\DataObject\Classificationstore|null $technicalAttributes
  333. * @return \Pimcore\Model\DataObject\AccessoryPart
  334. */
  335. public function setTechnicalAttributes(?\Pimcore\Model\DataObject\Classificationstore $technicalAttributes)
  336. {
  337.     $this->technicalAttributes $technicalAttributes;
  338.     return $this;
  339. }
  340. /**
  341. * Get image - image
  342. * @return \Pimcore\Model\DataObject\Data\Hotspotimage|null
  343. */
  344. public function getImage(): ?\Pimcore\Model\DataObject\Data\Hotspotimage
  345. {
  346.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  347.         $preValue $this->preGetValue("image");
  348.         if ($preValue !== null) {
  349.             return $preValue;
  350.         }
  351.     }
  352.     $data $this->image;
  353.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  354.         return $data->getPlain();
  355.     }
  356.     return $data;
  357. }
  358. /**
  359. * Set image - image
  360. * @param \Pimcore\Model\DataObject\Data\Hotspotimage|null $image
  361. * @return \Pimcore\Model\DataObject\AccessoryPart
  362. */
  363. public function setImage(?\Pimcore\Model\DataObject\Data\Hotspotimage $image)
  364. {
  365.     $this->image $image;
  366.     return $this;
  367. }
  368. /**
  369. * Get additionalCategories - Additional Categories
  370. * @return \Pimcore\Model\DataObject\Category[]
  371. */
  372. public function getAdditionalCategories(): array
  373. {
  374.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  375.         $preValue $this->preGetValue("additionalCategories");
  376.         if ($preValue !== null) {
  377.             return $preValue;
  378.         }
  379.     }
  380.     $data $this->getClass()->getFieldDefinition("additionalCategories")->preGetData($this);
  381.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  382.         return $data->getPlain();
  383.     }
  384.     return $data;
  385. }
  386. /**
  387. * Set additionalCategories - Additional Categories
  388. * @param \Pimcore\Model\DataObject\Category[] $additionalCategories
  389. * @return \Pimcore\Model\DataObject\AccessoryPart
  390. */
  391. public function setAdditionalCategories(?array $additionalCategories)
  392. {
  393.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  394.     $fd $this->getClass()->getFieldDefinition("additionalCategories");
  395.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  396.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  397.     $currentData $this->getAdditionalCategories();
  398.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  399.     $isEqual $fd->isEqual($currentData$additionalCategories);
  400.     if (!$isEqual) {
  401.         $this->markFieldDirty("additionalCategories"true);
  402.     }
  403.     $this->additionalCategories $fd->preSetData($this$additionalCategories);
  404.     return $this;
  405. }
  406. /**
  407. * Get erpNumber - ERP Number
  408. * @return string|null
  409. */
  410. public function getErpNumber(): ?string
  411. {
  412.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  413.         $preValue $this->preGetValue("erpNumber");
  414.         if ($preValue !== null) {
  415.             return $preValue;
  416.         }
  417.     }
  418.     $data $this->erpNumber;
  419.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  420.         return $data->getPlain();
  421.     }
  422.     return $data;
  423. }
  424. /**
  425. * Set erpNumber - ERP Number
  426. * @param string|null $erpNumber
  427. * @return \Pimcore\Model\DataObject\AccessoryPart
  428. */
  429. public function setErpNumber(?string $erpNumber)
  430. {
  431.     $this->erpNumber $erpNumber;
  432.     return $this;
  433. }
  434. /**
  435. * Get categoryCode - Category Code
  436. * @return string|null
  437. */
  438. public function getCategoryCode(): ?string
  439. {
  440.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  441.         $preValue $this->preGetValue("categoryCode");
  442.         if ($preValue !== null) {
  443.             return $preValue;
  444.         }
  445.     }
  446.     $data $this->categoryCode;
  447.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  448.         return $data->getPlain();
  449.     }
  450.     return $data;
  451. }
  452. /**
  453. * Set categoryCode - Category Code
  454. * @param string|null $categoryCode
  455. * @return \Pimcore\Model\DataObject\AccessoryPart
  456. */
  457. public function setCategoryCode(?string $categoryCode)
  458. {
  459.     $this->categoryCode $categoryCode;
  460.     return $this;
  461. }
  462. /**
  463. * Get owner - Owner
  464. * @return string|null
  465. */
  466. public function getOwner(): ?string
  467. {
  468.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  469.         $preValue $this->preGetValue("owner");
  470.         if ($preValue !== null) {
  471.             return $preValue;
  472.         }
  473.     }
  474.     $data $this->owner;
  475.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  476.         return $data->getPlain();
  477.     }
  478.     return $data;
  479. }
  480. /**
  481. * Set owner - Owner
  482. * @param string|null $owner
  483. * @return \Pimcore\Model\DataObject\AccessoryPart
  484. */
  485. public function setOwner(?string $owner)
  486. {
  487.     $this->owner $owner;
  488.     return $this;
  489. }
  490. /**
  491. * @return \Pimcore\Model\DataObject\AccessoryPart\SaleInformation
  492. */
  493. public function getSaleInformation(): ?\Pimcore\Model\DataObject\Objectbrick
  494. {
  495.     $data $this->saleInformation;
  496.     if (!$data) {
  497.         if (\Pimcore\Tool::classExists("\\Pimcore\\Model\\DataObject\\AccessoryPart\\SaleInformation")) {
  498.             $data = new \Pimcore\Model\DataObject\AccessoryPart\SaleInformation($this"saleInformation");
  499.             $this->saleInformation $data;
  500.         } else {
  501.             return null;
  502.         }
  503.     }
  504.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  505.         $preValue $this->preGetValue("saleInformation");
  506.         if ($preValue !== null) {
  507.             return $preValue;
  508.         }
  509.     }
  510.     return $data;
  511. }
  512. /**
  513. * Set saleInformation - 
  514. * @param \Pimcore\Model\DataObject\Objectbrick|null $saleInformation
  515. * @return \Pimcore\Model\DataObject\AccessoryPart
  516. */
  517. public function setSaleInformation(?\Pimcore\Model\DataObject\Objectbrick $saleInformation)
  518. {
  519.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Objectbricks $fd */
  520.     $fd $this->getClass()->getFieldDefinition("saleInformation");
  521.     $this->saleInformation $fd->preSetData($this$saleInformation);
  522.     return $this;
  523. }
  524. /**
  525. * Get urlSlug - UrlSlug
  526. * @return \Pimcore\Model\DataObject\Data\UrlSlug[]
  527. */
  528. public function getUrlSlug(): ?array
  529. {
  530.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  531.         $preValue $this->preGetValue("urlSlug");
  532.         if ($preValue !== null) {
  533.             return $preValue;
  534.         }
  535.     }
  536.     $data $this->getClass()->getFieldDefinition("urlSlug")->preGetData($this);
  537.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  538.         return $data->getPlain();
  539.     }
  540.     return $data;
  541. }
  542. /**
  543. * Set urlSlug - UrlSlug
  544. * @param \Pimcore\Model\DataObject\Data\UrlSlug[] $urlSlug
  545. * @return \Pimcore\Model\DataObject\AccessoryPart
  546. */
  547. public function setUrlSlug(?array $urlSlug)
  548. {
  549.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\UrlSlug $fd */
  550.     $fd $this->getClass()->getFieldDefinition("urlSlug");
  551.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  552.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  553.     $currentData $this->getUrlSlug();
  554.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  555.     $isEqual $fd->isEqual($currentData$urlSlug);
  556.     if (!$isEqual) {
  557.         $this->markFieldDirty("urlSlug"true);
  558.     }
  559.     $this->urlSlug $fd->preSetData($this$urlSlug);
  560.     return $this;
  561. }
  562. }