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

        $converter = $this->getQueryRelConverter($store, $relMeta);

        if (true === $relMeta->isPolymorphic()) {
            $key = sprintf('%s.%s', $key, Persister::IDENTIFIER_KEY);
        }

        if (is_array($value)) {
            $value = (true === $this->hasOperators($value)) ? $value : ['$in' => $value];
            return [$key, $this->formatQueryExpression($value, $converter)];
        }
        return [$key, $converter($value)];
    }
private function formatQueryElementRel($key, $value, EntityMetadata $metadata, Store $store)
    {
        if (null === $relMeta = $metadata->getRelationship($key)) {
            return;
        }

        $converter = $this->getQueryRelConverter($store, $relMeta);

        if (true === $relMeta->isPolymorphic()) {
            $key = sprintf('%s.%s', $key, Persister::IDENTIFIER_KEY);
        }

        if (is_array($value)) {
            $value = (true === $this->hasOperators($value)) ? $value : ['$in' => $value];
            return [$key, $this->formatQueryExpression($value, $converter)];
        }
        return [$key, $converter($value)];
    }
private function formatQueryElementRel ( $ key , $ value , EntityMetadata $ metadata , Store $ store ) { if ( null === $ relMeta = $ metadata -> getRelationship ( $ key ) ) { return ; } $ converter = $ this -> getQueryRelConverter ( $ store , $ relMeta ) ; if ( true === $ relMeta -> isPolymorphic ( ) ) { $ key = sprintf ( '%s.%s' , $ key , Persister :: IDENTIFIER_KEY ) ; } if ( is_array ( $ value ) ) { $ value = ( true === $ this -> hasOperators ( $ value ) ) ? $ value : [ '$in' => $ value ] ; return [ $ key , $ this -> formatQueryExpression ( $ value , $ converter ) ] ; } return [ $ key , $ converter ( $ value ) ] ; }
Formats a relationship query element.
Returns a tuple of the formatted key and value, or null if the key is not a relationship field.

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