var/classes/DataObject/FilterDefinition.php line 46

Open in your IDE?
  1. <?php
  2. /**
  3. * Inheritance: yes
  4. * Variants: no
  5. Fields Summary:
  6. - pageLimit [numeric]
  7. - defaultOrderByInheritance [select]
  8. - defaultOrderBy [fieldcollections]
  9. - orderByAsc [indexFieldSelectionField]
  10. - orderByDesc [indexFieldSelectionField]
  11. - ajaxReload [checkbox]
  12. - infiniteScroll [checkbox]
  13. - limitOnFirstLoad [numeric]
  14. - conditionsInheritance [select]
  15. - conditions [fieldcollections]
  16. - filtersInheritance [select]
  17. - filters [fieldcollections]
  18. - crossSellingCategory [manyToOneRelation]
  19. - similarityFieldsInheritance [select]
  20. - similarityFields [fieldcollections]
  21. */
  22. namespace Pimcore\Model\DataObject;
  23. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  24. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  25. /**
  26. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing getList()
  27. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByPageLimit($value, $limit = 0, $offset = 0, $objectTypes = null)
  28. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByDefaultOrderByInheritance($value, $limit = 0, $offset = 0, $objectTypes = null)
  29. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByOrderByAsc($value, $limit = 0, $offset = 0, $objectTypes = null)
  30. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByOrderByDesc($value, $limit = 0, $offset = 0, $objectTypes = null)
  31. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByAjaxReload($value, $limit = 0, $offset = 0, $objectTypes = null)
  32. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByInfiniteScroll($value, $limit = 0, $offset = 0, $objectTypes = null)
  33. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByLimitOnFirstLoad($value, $limit = 0, $offset = 0, $objectTypes = null)
  34. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByConditionsInheritance($value, $limit = 0, $offset = 0, $objectTypes = null)
  35. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByFiltersInheritance($value, $limit = 0, $offset = 0, $objectTypes = null)
  36. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getByCrossSellingCategory($value, $limit = 0, $offset = 0, $objectTypes = null)
  37. * @method static \Pimcore\Model\DataObject\FilterDefinition\Listing|\Pimcore\Model\DataObject\FilterDefinition|null getBySimilarityFieldsInheritance($value, $limit = 0, $offset = 0, $objectTypes = null)
  38. */
  39. class FilterDefinition extends \Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractFilterDefinition
  40. {
  41. protected $o_classId "EF_FD";
  42. protected $o_className "FilterDefinition";
  43. protected $pageLimit;
  44. protected $defaultOrderByInheritance;
  45. protected $defaultOrderBy;
  46. protected $orderByAsc;
  47. protected $orderByDesc;
  48. protected $ajaxReload;
  49. protected $infiniteScroll;
  50. protected $limitOnFirstLoad;
  51. protected $conditionsInheritance;
  52. protected $conditions;
  53. protected $filtersInheritance;
  54. protected $filters;
  55. protected $crossSellingCategory;
  56. protected $similarityFieldsInheritance;
  57. protected $similarityFields;
  58. /**
  59. * @param array $values
  60. * @return \Pimcore\Model\DataObject\FilterDefinition
  61. */
  62. public static function create($values = array()) {
  63.     $object = new static();
  64.     $object->setValues($values);
  65.     return $object;
  66. }
  67. /**
  68. * Get pageLimit - Results per Page
  69. * @return float|null
  70. */
  71. public function getPageLimit(): ?float
  72. {
  73.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  74.         $preValue $this->preGetValue("pageLimit");
  75.         if ($preValue !== null) {
  76.             return $preValue;
  77.         }
  78.     }
  79.     $data $this->pageLimit;
  80.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("pageLimit")->isEmpty($data)) {
  81.         try {
  82.             return $this->getValueFromParent("pageLimit");
  83.         } catch (InheritanceParentNotFoundException $e) {
  84.             // no data from parent available, continue ...
  85.         }
  86.     }
  87.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  88.         return $data->getPlain();
  89.     }
  90.     return $data;
  91. }
  92. /**
  93. * Set pageLimit - Results per Page
  94. * @param float|null $pageLimit
  95. * @return \Pimcore\Model\DataObject\FilterDefinition
  96. */
  97. public function setPageLimit(?float $pageLimit)
  98. {
  99.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  100.     $fd $this->getClass()->getFieldDefinition("pageLimit");
  101.     $this->pageLimit $fd->preSetData($this$pageLimit);
  102.     return $this;
  103. }
  104. /**
  105. * Get defaultOrderByInheritance - inherit Default OrderBy
  106. * @return string|null
  107. */
  108. public function getDefaultOrderByInheritance(): ?string
  109. {
  110.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  111.         $preValue $this->preGetValue("defaultOrderByInheritance");
  112.         if ($preValue !== null) {
  113.             return $preValue;
  114.         }
  115.     }
  116.     $data $this->defaultOrderByInheritance;
  117.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("defaultOrderByInheritance")->isEmpty($data)) {
  118.         try {
  119.             return $this->getValueFromParent("defaultOrderByInheritance");
  120.         } catch (InheritanceParentNotFoundException $e) {
  121.             // no data from parent available, continue ...
  122.         }
  123.     }
  124.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  125.         return $data->getPlain();
  126.     }
  127.     return $data;
  128. }
  129. /**
  130. * Set defaultOrderByInheritance - inherit Default OrderBy
  131. * @param string|null $defaultOrderByInheritance
  132. * @return \Pimcore\Model\DataObject\FilterDefinition
  133. */
  134. public function setDefaultOrderByInheritance(?string $defaultOrderByInheritance)
  135. {
  136.     $this->defaultOrderByInheritance $defaultOrderByInheritance;
  137.     return $this;
  138. }
  139. /**
  140. * @return \Pimcore\Model\DataObject\Fieldcollection|null
  141. */
  142. public function getDefaultOrderBy()
  143. {
  144.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  145.         $preValue $this->preGetValue("defaultOrderBy");
  146.         if ($preValue !== null) {
  147.             return $preValue;
  148.         }
  149.     }
  150.     $data $this->getClass()->getFieldDefinition("defaultOrderBy")->preGetData($this);
  151.     return $data;
  152. }
  153. /**
  154. * Set defaultOrderBy - Default OrderBy
  155. * @param \Pimcore\Model\DataObject\Fieldcollection|null $defaultOrderBy
  156. * @return \Pimcore\Model\DataObject\FilterDefinition
  157. */
  158. public function setDefaultOrderBy(?\Pimcore\Model\DataObject\Fieldcollection $defaultOrderBy)
  159. {
  160.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Fieldcollections $fd */
  161.     $fd $this->getClass()->getFieldDefinition("defaultOrderBy");
  162.     $this->defaultOrderBy $fd->preSetData($this$defaultOrderBy);
  163.     return $this;
  164. }
  165. /**
  166. * Get orderByAsc - OrderBy
  167. * @return string|null
  168. */
  169. public function getOrderByAsc(): ?string
  170. {
  171.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  172.         $preValue $this->preGetValue("orderByAsc");
  173.         if ($preValue !== null) {
  174.             return $preValue;
  175.         }
  176.     }
  177.     $data $this->orderByAsc;
  178.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("orderByAsc")->isEmpty($data)) {
  179.         try {
  180.             return $this->getValueFromParent("orderByAsc");
  181.         } catch (InheritanceParentNotFoundException $e) {
  182.             // no data from parent available, continue ...
  183.         }
  184.     }
  185.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  186.         return $data->getPlain();
  187.     }
  188.     return $data;
  189. }
  190. /**
  191. * Set orderByAsc - OrderBy
  192. * @param string|null $orderByAsc
  193. * @return \Pimcore\Model\DataObject\FilterDefinition
  194. */
  195. public function setOrderByAsc(?string $orderByAsc)
  196. {
  197.     $this->orderByAsc $orderByAsc;
  198.     return $this;
  199. }
  200. /**
  201. * Get orderByDesc - OrderBy Descending
  202. * @return string|null
  203. */
  204. public function getOrderByDesc(): ?string
  205. {
  206.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  207.         $preValue $this->preGetValue("orderByDesc");
  208.         if ($preValue !== null) {
  209.             return $preValue;
  210.         }
  211.     }
  212.     $data $this->orderByDesc;
  213.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("orderByDesc")->isEmpty($data)) {
  214.         try {
  215.             return $this->getValueFromParent("orderByDesc");
  216.         } catch (InheritanceParentNotFoundException $e) {
  217.             // no data from parent available, continue ...
  218.         }
  219.     }
  220.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  221.         return $data->getPlain();
  222.     }
  223.     return $data;
  224. }
  225. /**
  226. * Set orderByDesc - OrderBy Descending
  227. * @param string|null $orderByDesc
  228. * @return \Pimcore\Model\DataObject\FilterDefinition
  229. */
  230. public function setOrderByDesc(?string $orderByDesc)
  231. {
  232.     $this->orderByDesc $orderByDesc;
  233.     return $this;
  234. }
  235. /**
  236. * Get ajaxReload - ajaxReload
  237. * @return bool|null
  238. */
  239. public function getAjaxReload(): ?bool
  240. {
  241.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  242.         $preValue $this->preGetValue("ajaxReload");
  243.         if ($preValue !== null) {
  244.             return $preValue;
  245.         }
  246.     }
  247.     $data $this->ajaxReload;
  248.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("ajaxReload")->isEmpty($data)) {
  249.         try {
  250.             return $this->getValueFromParent("ajaxReload");
  251.         } catch (InheritanceParentNotFoundException $e) {
  252.             // no data from parent available, continue ...
  253.         }
  254.     }
  255.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  256.         return $data->getPlain();
  257.     }
  258.     return $data;
  259. }
  260. /**
  261. * Set ajaxReload - ajaxReload
  262. * @param bool|null $ajaxReload
  263. * @return \Pimcore\Model\DataObject\FilterDefinition
  264. */
  265. public function setAjaxReload(?bool $ajaxReload)
  266. {
  267.     $this->ajaxReload $ajaxReload;
  268.     return $this;
  269. }
  270. /**
  271. * Get infiniteScroll - Infinite Scroll
  272. * @return bool|null
  273. */
  274. public function getInfiniteScroll(): ?bool
  275. {
  276.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  277.         $preValue $this->preGetValue("infiniteScroll");
  278.         if ($preValue !== null) {
  279.             return $preValue;
  280.         }
  281.     }
  282.     $data $this->infiniteScroll;
  283.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("infiniteScroll")->isEmpty($data)) {
  284.         try {
  285.             return $this->getValueFromParent("infiniteScroll");
  286.         } catch (InheritanceParentNotFoundException $e) {
  287.             // no data from parent available, continue ...
  288.         }
  289.     }
  290.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  291.         return $data->getPlain();
  292.     }
  293.     return $data;
  294. }
  295. /**
  296. * Set infiniteScroll - Infinite Scroll
  297. * @param bool|null $infiniteScroll
  298. * @return \Pimcore\Model\DataObject\FilterDefinition
  299. */
  300. public function setInfiniteScroll(?bool $infiniteScroll)
  301. {
  302.     $this->infiniteScroll $infiniteScroll;
  303.     return $this;
  304. }
  305. /**
  306. * Get limitOnFirstLoad - Limit on First Load
  307. * @return float|null
  308. */
  309. public function getLimitOnFirstLoad(): ?float
  310. {
  311.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  312.         $preValue $this->preGetValue("limitOnFirstLoad");
  313.         if ($preValue !== null) {
  314.             return $preValue;
  315.         }
  316.     }
  317.     $data $this->limitOnFirstLoad;
  318.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("limitOnFirstLoad")->isEmpty($data)) {
  319.         try {
  320.             return $this->getValueFromParent("limitOnFirstLoad");
  321.         } catch (InheritanceParentNotFoundException $e) {
  322.             // no data from parent available, continue ...
  323.         }
  324.     }
  325.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  326.         return $data->getPlain();
  327.     }
  328.     return $data;
  329. }
  330. /**
  331. * Set limitOnFirstLoad - Limit on First Load
  332. * @param float|null $limitOnFirstLoad
  333. * @return \Pimcore\Model\DataObject\FilterDefinition
  334. */
  335. public function setLimitOnFirstLoad(?float $limitOnFirstLoad)
  336. {
  337.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Numeric $fd */
  338.     $fd $this->getClass()->getFieldDefinition("limitOnFirstLoad");
  339.     $this->limitOnFirstLoad $fd->preSetData($this$limitOnFirstLoad);
  340.     return $this;
  341. }
  342. /**
  343. * Get conditionsInheritance - inherit Conditions
  344. * @return string|null
  345. */
  346. public function getConditionsInheritance(): ?string
  347. {
  348.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  349.         $preValue $this->preGetValue("conditionsInheritance");
  350.         if ($preValue !== null) {
  351.             return $preValue;
  352.         }
  353.     }
  354.     $data $this->conditionsInheritance;
  355.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("conditionsInheritance")->isEmpty($data)) {
  356.         try {
  357.             return $this->getValueFromParent("conditionsInheritance");
  358.         } catch (InheritanceParentNotFoundException $e) {
  359.             // no data from parent available, continue ...
  360.         }
  361.     }
  362.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  363.         return $data->getPlain();
  364.     }
  365.     return $data;
  366. }
  367. /**
  368. * Set conditionsInheritance - inherit Conditions
  369. * @param string|null $conditionsInheritance
  370. * @return \Pimcore\Model\DataObject\FilterDefinition
  371. */
  372. public function setConditionsInheritance(?string $conditionsInheritance)
  373. {
  374.     $this->conditionsInheritance $conditionsInheritance;
  375.     return $this;
  376. }
  377. /**
  378. * @return \Pimcore\Model\DataObject\Fieldcollection|null
  379. */
  380. public function getConditions()
  381. {
  382.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  383.         $preValue $this->preGetValue("conditions");
  384.         if ($preValue !== null) {
  385.             return $preValue;
  386.         }
  387.     }
  388.     $data $this->getClass()->getFieldDefinition("conditions")->preGetData($this);
  389.     return $data;
  390. }
  391. /**
  392. * Set conditions - Conditions
  393. * @param \Pimcore\Model\DataObject\Fieldcollection|null $conditions
  394. * @return \Pimcore\Model\DataObject\FilterDefinition
  395. */
  396. public function setConditions(?\Pimcore\Model\DataObject\Fieldcollection $conditions)
  397. {
  398.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Fieldcollections $fd */
  399.     $fd $this->getClass()->getFieldDefinition("conditions");
  400.     $this->conditions $fd->preSetData($this$conditions);
  401.     return $this;
  402. }
  403. /**
  404. * Get filtersInheritance - inherit Filters
  405. * @return string|null
  406. */
  407. public function getFiltersInheritance(): ?string
  408. {
  409.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  410.         $preValue $this->preGetValue("filtersInheritance");
  411.         if ($preValue !== null) {
  412.             return $preValue;
  413.         }
  414.     }
  415.     $data $this->filtersInheritance;
  416.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("filtersInheritance")->isEmpty($data)) {
  417.         try {
  418.             return $this->getValueFromParent("filtersInheritance");
  419.         } catch (InheritanceParentNotFoundException $e) {
  420.             // no data from parent available, continue ...
  421.         }
  422.     }
  423.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  424.         return $data->getPlain();
  425.     }
  426.     return $data;
  427. }
  428. /**
  429. * Set filtersInheritance - inherit Filters
  430. * @param string|null $filtersInheritance
  431. * @return \Pimcore\Model\DataObject\FilterDefinition
  432. */
  433. public function setFiltersInheritance(?string $filtersInheritance)
  434. {
  435.     $this->filtersInheritance $filtersInheritance;
  436.     return $this;
  437. }
  438. /**
  439. * @return \Pimcore\Model\DataObject\Fieldcollection|null
  440. */
  441. public function getFilters()
  442. {
  443.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  444.         $preValue $this->preGetValue("filters");
  445.         if ($preValue !== null) {
  446.             return $preValue;
  447.         }
  448.     }
  449.     $data $this->getClass()->getFieldDefinition("filters")->preGetData($this);
  450.     return $data;
  451. }
  452. /**
  453. * Set filters - Filters
  454. * @param \Pimcore\Model\DataObject\Fieldcollection|null $filters
  455. * @return \Pimcore\Model\DataObject\FilterDefinition
  456. */
  457. public function setFilters(?\Pimcore\Model\DataObject\Fieldcollection $filters)
  458. {
  459.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Fieldcollections $fd */
  460.     $fd $this->getClass()->getFieldDefinition("filters");
  461.     $this->filters $fd->preSetData($this$filters);
  462.     return $this;
  463. }
  464. /**
  465. * Get crossSellingCategory - Base category for recommendations
  466. * @return \Pimcore\Model\DataObject\ProductCategory|null
  467. */
  468. public function getCrossSellingCategory(): ?\Pimcore\Model\Element\AbstractElement
  469. {
  470.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  471.         $preValue $this->preGetValue("crossSellingCategory");
  472.         if ($preValue !== null) {
  473.             return $preValue;
  474.         }
  475.     }
  476.     $data $this->getClass()->getFieldDefinition("crossSellingCategory")->preGetData($this);
  477.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("crossSellingCategory")->isEmpty($data)) {
  478.         try {
  479.             return $this->getValueFromParent("crossSellingCategory");
  480.         } catch (InheritanceParentNotFoundException $e) {
  481.             // no data from parent available, continue ...
  482.         }
  483.     }
  484.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  485.         return $data->getPlain();
  486.     }
  487.     return $data;
  488. }
  489. /**
  490. * Set crossSellingCategory - Base category for recommendations
  491. * @param \Pimcore\Model\DataObject\ProductCategory $crossSellingCategory
  492. * @return \Pimcore\Model\DataObject\FilterDefinition
  493. */
  494. public function setCrossSellingCategory(?\Pimcore\Model\Element\AbstractElement $crossSellingCategory)
  495. {
  496.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToOneRelation $fd */
  497.     $fd $this->getClass()->getFieldDefinition("crossSellingCategory");
  498.     $inheritValues self::getGetInheritedValues();
  499.     self::setGetInheritedValues(false);
  500.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  501.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  502.     $currentData $this->getCrossSellingCategory();
  503.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  504.     self::setGetInheritedValues($inheritValues);
  505.     $isEqual $fd->isEqual($currentData$crossSellingCategory);
  506.     if (!$isEqual) {
  507.         $this->markFieldDirty("crossSellingCategory"true);
  508.     }
  509.     $this->crossSellingCategory $fd->preSetData($this$crossSellingCategory);
  510.     return $this;
  511. }
  512. /**
  513. * Get similarityFieldsInheritance - inherit SimilarityFields
  514. * @return string|null
  515. */
  516. public function getSimilarityFieldsInheritance(): ?string
  517. {
  518.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  519.         $preValue $this->preGetValue("similarityFieldsInheritance");
  520.         if ($preValue !== null) {
  521.             return $preValue;
  522.         }
  523.     }
  524.     $data $this->similarityFieldsInheritance;
  525.     if (\Pimcore\Model\DataObject::doGetInheritedValues() && $this->getClass()->getFieldDefinition("similarityFieldsInheritance")->isEmpty($data)) {
  526.         try {
  527.             return $this->getValueFromParent("similarityFieldsInheritance");
  528.         } catch (InheritanceParentNotFoundException $e) {
  529.             // no data from parent available, continue ...
  530.         }
  531.     }
  532.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  533.         return $data->getPlain();
  534.     }
  535.     return $data;
  536. }
  537. /**
  538. * Set similarityFieldsInheritance - inherit SimilarityFields
  539. * @param string|null $similarityFieldsInheritance
  540. * @return \Pimcore\Model\DataObject\FilterDefinition
  541. */
  542. public function setSimilarityFieldsInheritance(?string $similarityFieldsInheritance)
  543. {
  544.     $this->similarityFieldsInheritance $similarityFieldsInheritance;
  545.     return $this;
  546. }
  547. /**
  548. * @return \Pimcore\Model\DataObject\Fieldcollection|null
  549. */
  550. public function getSimilarityFields()
  551. {
  552.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  553.         $preValue $this->preGetValue("similarityFields");
  554.         if ($preValue !== null) {
  555.             return $preValue;
  556.         }
  557.     }
  558.     $data $this->getClass()->getFieldDefinition("similarityFields")->preGetData($this);
  559.     return $data;
  560. }
  561. /**
  562. * Set similarityFields - SimilarityFields
  563. * @param \Pimcore\Model\DataObject\Fieldcollection|null $similarityFields
  564. * @return \Pimcore\Model\DataObject\FilterDefinition
  565. */
  566. public function setSimilarityFields(?\Pimcore\Model\DataObject\Fieldcollection $similarityFields)
  567. {
  568.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\Fieldcollections $fd */
  569.     $fd $this->getClass()->getFieldDefinition("similarityFields");
  570.     $this->similarityFields $fd->preSetData($this$similarityFields);
  571.     return $this;
  572. }
  573. }