src/Formatter.php
private function formatQueryElementDotted($key, $value, EntityMetadata $metadata, Store $store)
    {
        if (false === stripos($key, '.')) {
            return;
        }

        $parts = explode('.', $key);
        $root = array_shift($parts);
        if (false === $metadata->hasRelationship($root)) {
            // Nothing to format. Allow the dotted field to pass normally.
            return [$key, $value];
        }
        $hasIndex = is_numeric($parts[0]);

        if (true === $hasIndex) {
            $subKey = isset($parts[1]) ? $parts[1] : 'id';
        } else {
            $subKey = $parts[0];
        }

        if ($this->isIdentifierField($subKey)) {
            // Handle like a regular relationship
            list($key, $value) = $this->formatQueryElementRel($root, $value, $metadata, $store);
            $key = (true === $hasIndex) ? sprintf('%s.%s', $key, $parts[0]) : $key;
            return [$key, $value];
        }

        if ($this->isTypeField($subKey)) {
            // Handle as a model type field.
            list($key, $value) = $this->formatQueryElementRoot($subKey, $value, $metadata);
            $key = (true === $hasIndex) ? sprintf('%s.%s.%s', $root, $parts[0], $key) : sprintf('%s.%s', $root, $key);
            return [$key, $value];
        }
        return [$key, $value];
    }
private function formatQueryElementDotted($key, $value, EntityMetadata $metadata, Store $store)
    {
        if (false === stripos($key, '.')) {
            return;
        }

        $parts = explode('.', $key);
        $root = array_shift($parts);
        if (false === $metadata->hasRelationship($root)) {
            // Nothing to format. Allow the dotted field to pass normally.
            return [$key, $value];
        }
        $hasIndex = is_numeric($parts[0]);

        if (true === $hasIndex) {
            $subKey = isset($parts[1]) ? $parts[1] : 'id';
        } else {
            $subKey = $parts[0];
        }

        if ($this->isIdentifierField($subKey)) {
            // Handle like a regular relationship
            list($key, $value) = $this->formatQueryElementRel($root, $value, $metadata, $store);
            $key = (true === $hasIndex) ? sprintf('%s.%s', $key, $parts[0]) : $key;
            return [$key, $value];
        }

        if ($this->isTypeField($subKey)) {
            // Handle as a model type field.
            list($key, $value) = $this->formatQueryElementRoot($subKey, $value, $metadata);
            $key = (true === $hasIndex) ? sprintf('%s.%s.%s', $root, $parts[0], $key) : sprintf('%s.%s', $root, $key);
            return [$key, $value];
        }
        return [$key, $value];
    }
private function formatQueryElementDotted ( $ key , $ value , EntityMetadata $ metadata , Store $ store ) { if ( false === stripos ( $ key , '.' ) ) { return ; } $ parts = explode ( '.' , $ key ) ; $ root = array_shift ( $ parts ) ; if ( false === $ metadata -> hasRelationship ( $ root ) ) { // Nothing to format. Allow the dotted field to pass normally. return [ $ key , $ value ] ; } $ hasIndex = is_numeric ( $ parts [ 0 ] ) ; if ( true === $ hasIndex ) { $ subKey = isset ( $ parts [ 1 ] ) ? $ parts [ 1 ] : 'id' ; } else { $ subKey = $ parts [ 0 ] ; } if ( $ this -> isIdentifierField ( $ subKey ) ) { // Handle like a regular relationship list ( $ key , $ value ) = $ this -> formatQueryElementRel ( $ root , $ value , $ metadata , $ store ) ; $ key = ( true === $ hasIndex ) ? sprintf ( '%s.%s' , $ key , $ parts [ 0 ] ) : $ key ; return [ $ key , $ value ] ; } if ( $ this -> isTypeField ( $ subKey ) ) { // Handle as a model type field. list ( $ key , $ value ) = $ this -> formatQueryElementRoot ( $ subKey , $ value , $ metadata ) ; $ key = ( true === $ hasIndex ) ? sprintf ( '%s.%s.%s' , $ root , $ parts [ 0 ] , $ key ) : sprintf ( '%s.%s' , $ root , $ key ) ; return [ $ key , $ value ] ; } return [ $ key , $ value ] ; }
Formats a dot-notated field.
Returns a tuple of the formatted key and value, or null if the key is not a dot-notated field, or cannot be handled.

@param   string          $key
@param   mixed           $value
@param   EntityMetadata  $metadata
@param   Store           $store
@return  array|null
Formats a dot - notated field . Returns a tuple of the formatted key and value or null if the key is not a dot - notated field or cannot be handled .