Pop\Cache\Cache::factory PHP Method

factory() public static method

Static method to instantiate the cache object and return itself to facilitate chaining methods together.
public static factory ( Pop\Cache\Adapter\AdapterInterface $adapter, integer $lifetime ) : Cache
$adapter Pop\Cache\Adapter\AdapterInterface
$lifetime integer
return Cache
    public static function factory(Adapter\AdapterInterface $adapter, $lifetime = 0)
    {
        return new self($adapter, $lifetime);
    }

Usage Example

Example #1
0
 public function testGetVersion()
 {
     if (class_exists('Memcache')) {
         $c = Cache::factory(new Memcached(), 30);
         $this->assertNotNull($c->adapter()->getVersion());
     }
 }
All Usage Examples Of Pop\Cache\Cache::factory