public function buildFetch(OCClassSearchFormFetcher $fetcher, $requestKey, $requestValue, &$filters)
 {
     $className = $this->getBoundsClassName();
     $fieldName = ezfSolrDocumentFieldBase::getFieldName($this->contentClassAttribute, null, 'search');
     /** @var OCClassSearchFormFieldBoundsInterface $bounds */
     $bounds = $className::fromString($requestValue);
     $filters[] = $fieldName . ':[' . $bounds->attribute('start_solr') . ' TO ' . $bounds->attribute('end_solr') . ']';
     $fetcher->addFetchField(array('name' => $this->contentClassAttribute->attribute('name'), 'value' => $bounds->humanString(), 'remove_view_parameters' => $fetcher->getViewParametersString(array($requestKey))));
 }
 /**
  * @param array $baseParameters
  * @param array $requestFields
  * @param bool $parseViewParameter
  *
  * @return OCClassSearchFormFetcher
  */
 public static function result($baseParameters = array(), $requestFields = array(), $parseViewParameter = false)
 {
     if (self::$_result === null) {
         $result = new OCClassSearchFormFetcher();
         $result->setBaseParameters($baseParameters);
         $result->setRequestFields($requestFields, $parseViewParameter);
         self::$_result = $result;
     }
     return self::$_result;
 }
 public function buildFetch(OCClassSearchFormFetcher $fetcher, $requestKey, $requestValue, &$filters)
 {
     if (is_array($requestValue) && count($requestValue) == 1) {
         $requestValue = array_shift($requestValue);
     }
     $fieldName = ezfSolrDocumentFieldBase::getFieldName($this->contentClassAttribute, null, 'search');
     if (is_array($requestValue)) {
         $values = array('or');
         foreach ($requestValue as $v) {
             $values[] = $fieldName . ':' . $fetcher->encode($v, true);
         }
         $filters[] = $values;
     } else {
         $filters[] = $fieldName . ':' . $fetcher->encode($requestValue, true);
     }
     $fetcher->addFetchField(array('name' => $this->contentClassAttribute->attribute('name'), 'value' => $requestValue, 'remove_view_parameters' => $fetcher->getViewParametersString(array($requestKey))));
 }
 public function buildFetch(OCClassSearchFormFetcher $fetcher, $requestKey, $requestValue, &$filters)
 {
     if (is_array($requestValue) && count($requestValue) == 1) {
         $requestValue = array_shift($requestValue);
     }
     //@todo errore nella definzione del nome del sottoattributo? verifaicare vedi anceh in self::getValues
     //$fieldName = ezfSolrDocumentFieldBase::getFieldName( $this->contentClassAttribute, 'name', 'search' );
     $fieldName = ezfSolrDocumentFieldBase::$DocumentFieldName->lookupSchemaName(ezfSolrDocumentFieldBase::SUBATTR_FIELD_PREFIX . $this->contentClassAttribute->attribute('identifier') . ezfSolrDocumentFieldBase::SUBATTR_FIELD_SEPARATOR . 'name' . ezfSolrDocumentFieldBase::SUBATTR_FIELD_SEPARATOR, 'string');
     if (is_array($requestValue)) {
         $values = array('or');
         foreach ($requestValue as $v) {
             $values[] = $fieldName . ':' . $fetcher->encode($v, true);
         }
         $filters[] = $values;
     } else {
         $filters[] = $fieldName . ':' . $fetcher->encode($requestValue, true);
     }
     $fetcher->addFetchField(array('name' => $this->contentClassAttribute->attribute('name'), 'value' => $requestValue, 'remove_view_parameters' => $fetcher->getViewParametersString(array($requestKey))));
 }
 public function buildFetch(OCClassSearchFormFetcher $fetcher, $requestValue, &$filters)
 {
     $bounds = OCClassSearchFormPublishedFieldBounds::fromString($this->attributes['value']);
     $filters[] = eZSolr::getMetaFieldName('published') . ':[' . $bounds->attribute('start_solr') . ' TO ' . $bounds->attribute('end_solr') . ']';
     $fetcher->addFetchField(array('name' => $this->attributes['label'], 'value' => $bounds->humanString(), 'remove_view_parameters' => $fetcher->getViewParametersString(array('publish_date'))));
 }
 public function buildFetch(OCClassSearchFormFetcher $fetcher, $requestValue)
 {
     $this->attributes['query'] = $requestValue;
     $fetcher->addFetchField(array('name' => $this->attributes['label'], 'value' => $this->attributes['query'], 'remove_view_parameters' => $fetcher->getViewParametersString(array('query'))));
 }
 protected function fetch()
 {
     if (self::$_result == null) {
         if ($this->isFetch()) {
             $params = OCFacetNavgationHelper::map(array_merge($this->baseParameters, $this->currentParameters));
             self::$_result = OCFacetNavgationHelper::fetch($params, $this->searchText);
             if (self::$_result['SearchCount'] == 0) {
                 eZDebug::writeNotice($params);
                 eZDebug::writeNotice(self::$_result['SearchExtras']);
             }
         } else {
             self::$_result = false;
         }
     }
     return self::$_result;
 }