private function extractRelationship(array $parts)
    {
        if (isset($parts[2])) {
            if ('relationships' === $parts[2]) {
                if (!isset($parts[3])) {
                    throw RestException::invalidRelationshipEndpoint($this->parsedUri['path']);
                }
                $this->relationship = [
                    'type'  => 'self',
                    'field' => $parts[3],
                ];
            } else {
                $this->relationship = [
                    'type'  => 'related',
                    'field' => $parts[2],
                ];
            }
        }
        return $this;
    }
private function extractRelationship(array $parts)
    {
        if (isset($parts[2])) {
            if ('relationships' === $parts[2]) {
                if (!isset($parts[3])) {
                    throw RestException::invalidRelationshipEndpoint($this->parsedUri['path']);
                }
                $this->relationship = [
                    'type'  => 'self',
                    'field' => $parts[3],
                ];
            } else {
                $this->relationship = [
                    'type'  => 'related',
                    'field' => $parts[2],
                ];
            }
        }
        return $this;
    }
private function extractRelationship ( array $ parts ) { if ( isset ( $ parts [ 2 ] ) ) { if ( 'relationships' === $ parts [ 2 ] ) { if ( ! isset ( $ parts [ 3 ] ) ) { throw RestException :: invalidRelationshipEndpoint ( $ this -> parsedUri [ 'path' ] ) ; } $ this -> relationship = [ 'type' => 'self' , 'field' => $ parts [ 3 ] , ] ; } else { $ this -> relationship = [ 'type' => 'related' , 'field' => $ parts [ 2 ] , ] ; } } return $ this ; }
Extracts the entity relationship properties from an array of path parts.

@param   array   $parts
@return  self
Extracts the entity relationship properties from an array of path parts .