Odesk\Phystrix\RequestCache::get PHP Method

get() public method

Attempts to obtain cached result for a given command type
public get ( string $commandKey, string $cacheKey ) : mixed | null
$commandKey string
$cacheKey string
return mixed | null
    public function get($commandKey, $cacheKey)
    {
        if ($this->exists($commandKey, $cacheKey)) {
            return $this->cachedResults[$commandKey][$cacheKey];
        }
        return null;
    }

Usage Example

Example #1
0
 public function testClearAll()
 {
     $result = (object) array('a' => 123);
     $this->requestCache->put('TestCommand', 'cache-key-123', $result);
     $this->assertEquals($result, $this->requestCache->get('TestCommand', 'cache-key-123'));
     $this->requestCache->clearAll('TestCommand');
     $this->assertNull($this->requestCache->get('TestCommand', 'cache-key-123'));
 }
All Usage Examples Of Odesk\Phystrix\RequestCache::get