var/classes/DataObject/DemiFilterObject.php line 29

Open in your IDE?
  1. <?php
  2. /**
  3.  * Inheritance: no
  4.  * Variants: no
  5.  *
  6.  * Fields Summary:
  7.  * - localizedfields [localizedfields]
  8.  * -- name [input]
  9.  * - filterElements [manyToManyObjectRelation]
  10.  * - withApartments [checkbox]
  11.  * - withRooms [checkbox]
  12.  */
  13. namespace Pimcore\Model\DataObject;
  14. use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
  15. use Pimcore\Model\DataObject\PreGetValueHookInterface;
  16. /**
  17. * @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing getList(array $config = [])
  18. * @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  19. * @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
  20. * @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByFilterElements($value, $limit = 0, $offset = 0, $objectTypes = null)
  21. * @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByWithApartments($value, $limit = 0, $offset = 0, $objectTypes = null)
  22. * @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByWithRooms($value, $limit = 0, $offset = 0, $objectTypes = null)
  23. */
  24. class DemiFilterObject extends Concrete
  25. {
  26. protected $o_classId "31";
  27. protected $o_className "demiFilterObject";
  28. protected $localizedfields;
  29. protected $filterElements;
  30. protected $withApartments;
  31. protected $withRooms;
  32. /**
  33. * @param array $values
  34. * @return \Pimcore\Model\DataObject\DemiFilterObject
  35. */
  36. public static function create($values = array()) {
  37.     $object = new static();
  38.     $object->setValues($values);
  39.     return $object;
  40. }
  41. /**
  42. * Get localizedfields - 
  43. * @return \Pimcore\Model\DataObject\Localizedfield|null
  44. */
  45. public function getLocalizedfields()
  46. {
  47.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  48.         $preValue $this->preGetValue("localizedfields");
  49.         if ($preValue !== null) {
  50.             return $preValue;
  51.         }
  52.     }
  53.     $data $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
  54.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  55.         return $data->getPlain();
  56.     }
  57.     return $data;
  58. }
  59. /**
  60. * Get name - name
  61. * @return string|null
  62. */
  63. public function getName($language null)
  64. {
  65.     $data $this->getLocalizedfields()->getLocalizedValue("name"$language);
  66.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  67.         $preValue $this->preGetValue("name");
  68.         if ($preValue !== null) {
  69.             return $preValue;
  70.         }
  71.     }
  72.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  73.         return $data->getPlain();
  74.     }
  75.     return $data;
  76. }
  77. /**
  78. * Set localizedfields - 
  79. * @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
  80. * @return \Pimcore\Model\DataObject\DemiFilterObject
  81. */
  82. public function setLocalizedfields($localizedfields)
  83. {
  84.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  85.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  86.     $currentData $this->getLocalizedfields();
  87.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  88.     $this->markFieldDirty("localizedfields"true);
  89.     $this->localizedfields $localizedfields;
  90.     return $this;
  91. }
  92. /**
  93. * Set name - name
  94. * @param string|null $name
  95. * @return \Pimcore\Model\DataObject\DemiFilterObject
  96. */
  97. public function setName ($name$language null)
  98. {
  99.     $isEqual false;
  100.     $this->getLocalizedfields()->setLocalizedValue("name"$name$language, !$isEqual);
  101.     return $this;
  102. }
  103. /**
  104. * Get filterElements - filterElements
  105. * @return \Pimcore\Model\DataObject\DemiRegion[] | \Pimcore\Model\DataObject\DemiTown[] | \Pimcore\Model\DataObject\DemiMarketingGroup[] | \Pimcore\Model\DataObject\DemiCategory[] | \Pimcore\Model\DataObject\DemiHolidayTheme[] | \Pimcore\Model\DataObject\DemiFacility[] | \Pimcore\Model\DataObject\DemiStars[] | \Pimcore\Model\DataObject\DemiClassification[] | \Pimcore\Model\DataObject\DemiDistrict[]
  106. */
  107. public function getFilterElements()
  108. {
  109.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  110.         $preValue $this->preGetValue("filterElements");
  111.         if ($preValue !== null) {
  112.             return $preValue;
  113.         }
  114.     }
  115.     $data $this->getClass()->getFieldDefinition("filterElements")->preGetData($this);
  116.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  117.         return $data->getPlain();
  118.     }
  119.     return $data;
  120. }
  121. /**
  122. * Set filterElements - filterElements
  123. * @param \Pimcore\Model\DataObject\DemiRegion[] | \Pimcore\Model\DataObject\DemiTown[] | \Pimcore\Model\DataObject\DemiMarketingGroup[] | \Pimcore\Model\DataObject\DemiCategory[] | \Pimcore\Model\DataObject\DemiHolidayTheme[] | \Pimcore\Model\DataObject\DemiFacility[] | \Pimcore\Model\DataObject\DemiStars[] | \Pimcore\Model\DataObject\DemiClassification[] | \Pimcore\Model\DataObject\DemiDistrict[] $filterElements
  124. * @return \Pimcore\Model\DataObject\DemiFilterObject
  125. */
  126. public function setFilterElements($filterElements)
  127. {
  128.     /** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
  129.     $fd $this->getClass()->getFieldDefinition("filterElements");
  130.     $hideUnpublished \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
  131.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
  132.     $currentData $this->getFilterElements();
  133.     \Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
  134.     $isEqual $fd->isEqual($currentData$filterElements);
  135.     if (!$isEqual) {
  136.         $this->markFieldDirty("filterElements"true);
  137.     }
  138.     $this->filterElements $fd->preSetData($this$filterElements);
  139.     return $this;
  140. }
  141. /**
  142. * Get withApartments - withApartments
  143. * @return bool|null
  144. */
  145. public function getWithApartments()
  146. {
  147.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  148.         $preValue $this->preGetValue("withApartments");
  149.         if ($preValue !== null) {
  150.             return $preValue;
  151.         }
  152.     }
  153.     $data $this->withApartments;
  154.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  155.         return $data->getPlain();
  156.     }
  157.     return $data;
  158. }
  159. /**
  160. * Set withApartments - withApartments
  161. * @param bool|null $withApartments
  162. * @return \Pimcore\Model\DataObject\DemiFilterObject
  163. */
  164. public function setWithApartments($withApartments)
  165. {
  166.     $this->withApartments $withApartments;
  167.     return $this;
  168. }
  169. /**
  170. * Get withRooms - withRooms
  171. * @return bool|null
  172. */
  173. public function getWithRooms()
  174. {
  175.     if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
  176.         $preValue $this->preGetValue("withRooms");
  177.         if ($preValue !== null) {
  178.             return $preValue;
  179.         }
  180.     }
  181.     $data $this->withRooms;
  182.     if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
  183.         return $data->getPlain();
  184.     }
  185.     return $data;
  186. }
  187. /**
  188. * Set withRooms - withRooms
  189. * @param bool|null $withRooms
  190. * @return \Pimcore\Model\DataObject\DemiFilterObject
  191. */
  192. public function setWithRooms($withRooms)
  193. {
  194.     $this->withRooms $withRooms;
  195.     return $this;
  196. }
  197. }