Jyxo\Spl\ObjectCache::get PHP Method

get() public static method

Returns an object from the default storage.
public static get ( string $key ) : object
$key string Object key
return object
    public static function get($key)
    {
        return self::getInstance()->{$key};
    }

Usage Example

コード例 #1
0
ファイル: ObjectCacheTest.php プロジェクト: JerryCR/php-2
 /**
  * Tests saving data.
  */
 public function testSaveData()
 {
     $object = $this->saveObject();
     $this->assertSame($object, $this->cache->get(self::CACHE_KEY));
     // Saving using one way
     ObjectCache::set(self::CACHE_KEY, $object);
     $this->assertSame($object, $this->cache->get(self::CACHE_KEY));
     // Saving using the other way
     $this->cache->{self::CACHE_KEY} = $object;
     $this->assertSame($object, $this->cache->get(self::CACHE_KEY));
     $this->cache->clear();
 }
All Usage Examples Of Jyxo\Spl\ObjectCache::get