Newscoop\Service\Resource\ResourceRepository::cacheService PHP Method

cacheService() protected method

Provides to the cache the serice instance.
protected cacheService ( string $key, mixed $service ) : mixed
$key string The key to be used for caching the provided service instance, *(not null not empty).
$service mixed The service instance to cache, *(not null).
return mixed The cached service instance.
    protected function cacheService($key, $service)
    {
        if ($this->serviceCache === NULL) {
            $this->serviceCache = array();
        }
        $this->serviceCache[$key] = $service;
        return $service;
    }