ObjectCache
pattern is an extension to the CallbackCache pattern. It has the same methods but instead it generates the internally used callback in base of the configured object and the given method name.use Zend\Cache\PatternFactory;
$object = new stdClass();
$objectCache = PatternFactory::factory('object', array(
'object' => $object,
'storage' => 'apc'
));
Configuration Options :
Option | Data Type | Default Value | Description |
---|---|---|---|
storage | string array Zend\Cache\Storage\StorageInterface | <none> | The storage to write/read cached data |
object | object | <none> | The object to cache methods calls of |
object_key | null string | <Class name of object> | A hopefully unique key of the object |
cache_output | boolean | true | Cache output of callback |
cache_by_default | boolean | true | Cache method calls by default |
object_cache_methods | array | [] | List of methods to cache (If cache_by_default is disabled) |
object_non_cache_methods | array | [] | List of methods to no-cache (If cache_by_default is enabled) |
object_cache_magic_properties | boolean | false | Cache calls of magic object properties |