lib/Query/Common/CriterionVisitor/Field/FieldRange.php
public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
    {
        $searchFields = $this->getSearchFields($criterion);

        if (empty($searchFields)) {
            throw new InvalidArgumentException(
                '$criterion->target',
                "No searchable fields found for the given criterion target '{$criterion->target}'."
            );
        }

        $value = (array)$criterion->value;
        $queries = array();
        foreach ($searchFields as $name => $fieldType) {
            $start = $this->mapSearchFieldValue($value[0], $fieldType);
            $end = isset($value[1]) ? $this->mapSearchFieldvalue($value[1], $fieldType) : null;

            if (($criterion->operator === Operator::LT) ||
                  ($criterion->operator === Operator::LTE)) {
                $end = $start;
                $start = null;
            }

            $queries[] = $name . ':' . $this->getRange($criterion->operator, $start, $end);
        }

        return '(' . implode(' OR ', $queries) . ')';
    }
public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
    {
        $searchFields = $this->getSearchFields($criterion);

        if (empty($searchFields)) {
            throw new InvalidArgumentException(
                '$criterion->target',
                "No searchable fields found for the given criterion target '{$criterion->target}'."
            );
        }

        $value = (array)$criterion->value;
        $queries = array();
        foreach ($searchFields as $name => $fieldType) {
            $start = $this->mapSearchFieldValue($value[0], $fieldType);
            $end = isset($value[1]) ? $this->mapSearchFieldvalue($value[1], $fieldType) : null;

            if (($criterion->operator === Operator::LT) ||
                  ($criterion->operator === Operator::LTE)) {
                $end = $start;
                $start = null;
            }

            $queries[] = $name . ':' . $this->getRange($criterion->operator, $start, $end);
        }

        return '(' . implode(' OR ', $queries) . ')';
    }
public function visit ( Criterion $ criterion , CriterionVisitor $ subVisitor = null ) { $ searchFields = $ this -> getSearchFields ( $ criterion ) ; if ( empty ( $ searchFields ) ) { throw new InvalidArgumentException ( '$criterion->target' , "No searchable fields found for the given criterion target '{$criterion->target}'." ) ; } $ value = ( array ) $ criterion -> value ; $ queries = array ( ) ; foreach ( $ searchFields as $ name => $ fieldType ) { $ start = $ this -> mapSearchFieldValue ( $ value [ 0 ] , $ fieldType ) ; $ end = isset ( $ value [ 1 ] ) ? $ this -> mapSearchFieldvalue ( $ value [ 1 ] , $ fieldType ) : null ; if ( ( $ criterion -> operator === Operator :: LT ) || ( $ criterion -> operator === Operator :: LTE ) ) { $ end = $ start ; $ start = null ; } $ queries [ ] = $ name . ':' . $ this -> getRange ( $ criterion -> operator , $ start , $ end ) ; } return '(' . implode ( ' OR ' , $ queries ) . ')' ; }
Map field value to a proper Solr representation.

@throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentException If no searchable fields are found for the given criterion target.

@param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
@param \EzSystems\EzPlatformSolrSearchEngine\Query\CriterionVisitor $subVisitor

@return string
Map field value to a proper Solr representation .