<?php
/**
* Inheritance: no
* Variants: no
*
* Fields Summary:
* - localizedfields [localizedfields]
* -- name [input]
* - filterElements [manyToManyObjectRelation]
* - withApartments [checkbox]
* - withRooms [checkbox]
*/
namespace Pimcore\Model\DataObject;
use Pimcore\Model\DataObject\Exception\InheritanceParentNotFoundException;
use Pimcore\Model\DataObject\PreGetValueHookInterface;
/**
* @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing getList(array $config = [])
* @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByLocalizedfields($field, $value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByName($value, $locale = null, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByFilterElements($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByWithApartments($value, $limit = 0, $offset = 0, $objectTypes = null)
* @method static \Pimcore\Model\DataObject\DemiFilterObject\Listing|\Pimcore\Model\DataObject\DemiFilterObject|null getByWithRooms($value, $limit = 0, $offset = 0, $objectTypes = null)
*/
class DemiFilterObject extends Concrete
{
protected $o_classId = "31";
protected $o_className = "demiFilterObject";
protected $localizedfields;
protected $filterElements;
protected $withApartments;
protected $withRooms;
/**
* @param array $values
* @return \Pimcore\Model\DataObject\DemiFilterObject
*/
public static function create($values = array()) {
$object = new static();
$object->setValues($values);
return $object;
}
/**
* Get localizedfields -
* @return \Pimcore\Model\DataObject\Localizedfield|null
*/
public function getLocalizedfields()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("localizedfields");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("localizedfields")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Get name - name
* @return string|null
*/
public function getName($language = null)
{
$data = $this->getLocalizedfields()->getLocalizedValue("name", $language);
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("name");
if ($preValue !== null) {
return $preValue;
}
}
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set localizedfields -
* @param \Pimcore\Model\DataObject\Localizedfield|null $localizedfields
* @return \Pimcore\Model\DataObject\DemiFilterObject
*/
public function setLocalizedfields($localizedfields)
{
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getLocalizedfields();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$this->markFieldDirty("localizedfields", true);
$this->localizedfields = $localizedfields;
return $this;
}
/**
* Set name - name
* @param string|null $name
* @return \Pimcore\Model\DataObject\DemiFilterObject
*/
public function setName ($name, $language = null)
{
$isEqual = false;
$this->getLocalizedfields()->setLocalizedValue("name", $name, $language, !$isEqual);
return $this;
}
/**
* Get filterElements - filterElements
* @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[]
*/
public function getFilterElements()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("filterElements");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->getClass()->getFieldDefinition("filterElements")->preGetData($this);
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set filterElements - filterElements
* @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
* @return \Pimcore\Model\DataObject\DemiFilterObject
*/
public function setFilterElements($filterElements)
{
/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\ManyToManyObjectRelation $fd */
$fd = $this->getClass()->getFieldDefinition("filterElements");
$hideUnpublished = \Pimcore\Model\DataObject\Concrete::getHideUnpublished();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished(false);
$currentData = $this->getFilterElements();
\Pimcore\Model\DataObject\Concrete::setHideUnpublished($hideUnpublished);
$isEqual = $fd->isEqual($currentData, $filterElements);
if (!$isEqual) {
$this->markFieldDirty("filterElements", true);
}
$this->filterElements = $fd->preSetData($this, $filterElements);
return $this;
}
/**
* Get withApartments - withApartments
* @return bool|null
*/
public function getWithApartments()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("withApartments");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->withApartments;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set withApartments - withApartments
* @param bool|null $withApartments
* @return \Pimcore\Model\DataObject\DemiFilterObject
*/
public function setWithApartments($withApartments)
{
$this->withApartments = $withApartments;
return $this;
}
/**
* Get withRooms - withRooms
* @return bool|null
*/
public function getWithRooms()
{
if ($this instanceof PreGetValueHookInterface && !\Pimcore::inAdmin()) {
$preValue = $this->preGetValue("withRooms");
if ($preValue !== null) {
return $preValue;
}
}
$data = $this->withRooms;
if ($data instanceof \Pimcore\Model\DataObject\Data\EncryptedField) {
return $data->getPlain();
}
return $data;
}
/**
* Set withRooms - withRooms
* @param bool|null $withRooms
* @return \Pimcore\Model\DataObject\DemiFilterObject
*/
public function setWithRooms($withRooms)
{
$this->withRooms = $withRooms;
return $this;
}
}