protected function cacheManyRelationResults(string $parentKey, string $relation, $results, Relationship $relationship)
    {
        $this->cache[$parentKey][$relation] = [];

        foreach ($results as $result) {
            $cachedRelationship = $this->getCachedRelationship($relation, $result, $relationship);

            $relatedHash = $cachedRelationship->getHash();

            $this->cache[$parentKey][$relation][$relatedHash] = $cachedRelationship;
        }
    }
protected function cacheManyRelationResults(string $parentKey, string $relation, $results, Relationship $relationship)
    {
        $this->cache[$parentKey][$relation] = [];

        foreach ($results as $result) {
            $cachedRelationship = $this->getCachedRelationship($relation, $result, $relationship);

            $relatedHash = $cachedRelationship->getHash();

            $this->cache[$parentKey][$relation][$relatedHash] = $cachedRelationship;
        }
    }
protected function cacheManyRelationResults ( string $ parentKey , string $ relation , $ results , Relationship $ relationship ) { $ this -> cache [ $ parentKey ] [ $ relation ] = [ ] ; foreach ( $ results as $ result ) { $ cachedRelationship = $ this -> getCachedRelationship ( $ relation , $ result , $ relationship ) ; $ relatedHash = $ cachedRelationship -> getHash ( ) ; $ this -> cache [ $ parentKey ] [ $ relation ] [ $ relatedHash ] = $ cachedRelationship ; } }
Cache a many relationship.

@param string           $parentKey
@param string           $relation
@param EntityCollection $results
@param Relationship     $relationship

@throws MappingException
Cache a many relationship .