public function cacheLoadedRelationResult(string $key, string $relation, $results, Relationship $relationship)
    {
        if ($results instanceof EntityCollection) {
            $this->cacheManyRelationResults($key, $relation, $results, $relationship);
        }

        // TODO : As we support popo Entities, Maybe this check isn't needed anymore,
        // or we have to check that $result is an object instead
        if ($results instanceof Mappable) {
            $this->cacheSingleRelationResult($key, $relation, $results, $relationship);
        }
    }
public function cacheLoadedRelationResult(string $key, string $relation, $results, Relationship $relationship)
    {
        if ($results instanceof EntityCollection) {
            $this->cacheManyRelationResults($key, $relation, $results, $relationship);
        }

        // TODO : As we support popo Entities, Maybe this check isn't needed anymore,
        // or we have to check that $result is an object instead
        if ($results instanceof Mappable) {
            $this->cacheSingleRelationResult($key, $relation, $results, $relationship);
        }
    }
public function cacheLoadedRelationResult ( string $ key , string $ relation , $ results , Relationship $ relationship ) { if ( $ results instanceof EntityCollection ) { $ this -> cacheManyRelationResults ( $ key , $ relation , $ results , $ relationship ) ; } // TODO : As we support popo Entities, Maybe this check isn't needed anymore, // or we have to check that $result is an object instead if ( $ results instanceof Mappable ) { $ this -> cacheSingleRelationResult ( $ key , $ relation , $ results , $ relationship ) ; } }
Cache Relation's query result for an entity.

@param string       $key          primary key of the cached entity
@param string       $relation     name of the relation
@param mixed        $results      results of the relationship's query
@param Relationship $relationship

@throws MappingException

@return void
Cache Relation s query result for an entity .