public function buildFetch()
 {
     $filters = array();
     foreach ($this->requestFields as $key => $value) {
         if (strpos($key, OCClassSearchFormAttributeField::NAME_PREFIX) !== false) {
             $contentClassAttributeID = str_replace(OCClassSearchFormAttributeField::NAME_PREFIX, '', $key);
             $contentClassAttribute = eZContentClassAttribute::fetch($contentClassAttributeID);
             if ($contentClassAttribute instanceof eZContentClassAttribute) {
                 $field = OCClassSearchFormAttributeField::instance($contentClassAttribute);
                 $field->buildFetch($this, $key, $value, $filters);
                 $this->isFetch = true;
             }
         } elseif (in_array($key, OCFacetNavgationHelper::$allowedUserParamters)) {
             if (!empty($value)) {
                 $this->currentParameters[$key] = $value;
                 $this->isFetch = true;
             }
         } elseif ($key == 'class_id') {
             $this->currentParameters[$key] = $value;
             $this->addFetchField(array('name' => ezpI18n::tr('extension/ezfind/facets', 'Content type'), 'value' => eZContentClass::fetch($value)->attribute('name'), 'remove_view_parameters' => $this->getViewParametersString(array($key))));
             $this->isFetch = true;
         } elseif ($key == 'publish_date') {
             $publishedField = new OCClassSearchFormPublishedField($this->requestFields['class_id']);
             $publishedField->buildFetch($this, $value, $filters);
             $this->isFetch = true;
         } elseif ($key == 'query') {
             $queryField = new OCClassSearchFormQueryField();
             $queryField->buildFetch($this, $value);
             $this->searchText = $queryField->queryText();
             $this->isFetch = true;
         }
     }
     $this->currentParameters['filter'] = $filters;
     return $this->currentParameters;
 }
 /**
  * @param eZContentClassAttribute $attribute
  *
  * @return OCClassSearchFormAttributeField
  */
 public static function instance(eZContentClassAttribute $attribute)
 {
     if (self::$fieldHandlers === null) {
         self::$fieldHandlers = array();
         if (eZINI::instance('ocsearchtools.ini')->hasVariable('ClassSearchFormHandlers', 'AttributeHandlers')) {
             self::$fieldHandlers = eZINI::instance('ocsearchtools.ini')->variable('ClassSearchFormHandlers', 'AttributeHandlers');
         }
     }
     if (!isset(self::$_instances[$attribute->attribute('id')])) {
         if (isset(self::$fieldHandlers[$attribute->attribute('data_type_string')]) && class_exists(self::$fieldHandlers[$attribute->attribute('data_type_string')])) {
             $className = self::$fieldHandlers[$attribute->attribute('data_type_string')];
         } else {
             $className = 'OCClassSearchFormAttributeField';
         }
         self::$_instances[$attribute->attribute('id')] = new $className($attribute);
     }
     return self::$_instances[$attribute->attribute('id')];
 }
 /**
  * @return OCClassSearchFormAttributeField[]
  */
 public function attributeFields()
 {
     if ($this->attributeFields === null) {
         $this->attributeFields = array();
         $dataMap = $this->contentClass->attribute('data_map');
         $disabled = eZINI::instance('ocsearchtools.ini')->variable('ClassSearchFormSettings', 'DisabledAttributes');
         /** @var $dataMap eZContentClassAttribute[] */
         foreach ($dataMap as $attribute) {
             if (!in_array($this->contentClass->attribute('identifier') . '/' . $attribute->attribute('identifier'), $disabled) && $attribute->attribute('is_searchable')) {
                 $inputField = OCClassSearchFormAttributeField::instance($attribute);
                 $this->attributeFields[$inputField->attribute('id')] = $inputField;
             }
         }
     }
     return $this->attributeFields;
 }
 protected function __construct(eZContentClassAttribute $attribute)
 {
     parent::__construct($attribute);
     $this->functionAttributes['bounds'] = 'getBounds';
     $this->functionAttributes['current_bounds'] = 'getCurrentBounds';
 }