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)))); }