var/classes/DataObject/FilterDefinition.php line 45

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