private function querifyFieldValue($fieldValue)
    {
        if (is_array($fieldValue) && count($fieldValue) > 1) {
            sort($fieldValue);

            $quoted = array_map(function($value) {
                return '"'. $value .'"';
            }, $fieldValue);

            $fieldValue = implode(' TO ', $quoted);
            $fieldValue = '['. $fieldValue . ']';

            return $fieldValue;
        }

        if (is_array($fieldValue) && count($fieldValue) === 1) {
            $fieldValue = array_pop($fieldValue);
        }

        if ($this->useWildcards) {
            $fieldValue = '*' . $fieldValue . '*';
        }

        $termParts = explode(' ', $fieldValue);
        if (count($termParts) > 1) {
            $fieldValue = '"'.$fieldValue.'"';
        }

        return $fieldValue;
    }
private function querifyFieldValue($fieldValue)
    {
        if (is_array($fieldValue) && count($fieldValue) > 1) {
            sort($fieldValue);

            $quoted = array_map(function($value) {
                return '"'. $value .'"';
            }, $fieldValue);

            $fieldValue = implode(' TO ', $quoted);
            $fieldValue = '['. $fieldValue . ']';

            return $fieldValue;
        }

        if (is_array($fieldValue) && count($fieldValue) === 1) {
            $fieldValue = array_pop($fieldValue);
        }

        if ($this->useWildcards) {
            $fieldValue = '*' . $fieldValue . '*';
        }

        $termParts = explode(' ', $fieldValue);
        if (count($termParts) > 1) {
            $fieldValue = '"'.$fieldValue.'"';
        }

        return $fieldValue;
    }
private function querifyFieldValue ( $ fieldValue ) { if ( is_array ( $ fieldValue ) && count ( $ fieldValue ) > 1 ) { sort ( $ fieldValue ) ; $ quoted = array_map ( function ( $ value ) { return '"' . $ value . '"' ; } , $ fieldValue ) ; $ fieldValue = implode ( ' TO ' , $ quoted ) ; $ fieldValue = '[' . $ fieldValue . ']' ; return $ fieldValue ; } if ( is_array ( $ fieldValue ) && count ( $ fieldValue ) === 1 ) { $ fieldValue = array_pop ( $ fieldValue ) ; } if ( $ this -> useWildcards ) { $ fieldValue = '*' . $ fieldValue . '*' ; } $ termParts = explode ( ' ' , $ fieldValue ) ; if ( count ( $ termParts ) > 1 ) { $ fieldValue = '"' . $ fieldValue . '"' ; } return $ fieldValue ; }
Transforms array to string representation and adds quotes

@param string $fieldValue

@return string
Transforms array to string representation and adds quotes