src/Formatter.php
private function formatQueryElementAttr($key, $value, EntityMetadata $metadata, Store $store)
    {
        if (null === $attrMeta = $metadata->getAttribute($key)) {
            return;
        }

        $converter = $this->getQueryAttrConverter($store, $attrMeta);

        if (is_array($value)) {

            if (true === $this->hasOperators($value)) {
                return [$key, $this->formatQueryExpression($value, $converter)];
            }

            if (in_array($attrMeta->dataType, ['array', 'object'])) {
                return [$key, $value];
            }
            return [$key, $this->formatQueryExpression(['$in' => $value], $converter)];
        }
        return [$key, $converter($value)];
    }
private function formatQueryElementAttr($key, $value, EntityMetadata $metadata, Store $store)
    {
        if (null === $attrMeta = $metadata->getAttribute($key)) {
            return;
        }

        $converter = $this->getQueryAttrConverter($store, $attrMeta);

        if (is_array($value)) {

            if (true === $this->hasOperators($value)) {
                return [$key, $this->formatQueryExpression($value, $converter)];
            }

            if (in_array($attrMeta->dataType, ['array', 'object'])) {
                return [$key, $value];
            }
            return [$key, $this->formatQueryExpression(['$in' => $value], $converter)];
        }
        return [$key, $converter($value)];
    }
private function formatQueryElementAttr ( $ key , $ value , EntityMetadata $ metadata , Store $ store ) { if ( null === $ attrMeta = $ metadata -> getAttribute ( $ key ) ) { return ; } $ converter = $ this -> getQueryAttrConverter ( $ store , $ attrMeta ) ; if ( is_array ( $ value ) ) { if ( true === $ this -> hasOperators ( $ value ) ) { return [ $ key , $ this -> formatQueryExpression ( $ value , $ converter ) ] ; } if ( in_array ( $ attrMeta -> dataType , [ 'array' , 'object' ] ) ) { return [ $ key , $ value ] ; } return [ $ key , $ this -> formatQueryExpression ( [ '$in' => $ value ] , $ converter ) ] ; } return [ $ key , $ converter ( $ value ) ] ; }
Formats an attribute query element.
Returns a tuple of the formatted key and value, or null if the key is not an attribute field.

@param   string          $key
@param   mixed           $value
@param   EntityMetadata  $metadata
@param   Store           $store
@return  array|null
Formats an attribute query element . Returns a tuple of the formatted key and value or null if the key is not an attribute field .