Hi,
Using phalcon 2.0.1, I have added ORM caching to my project:
$di->set('modelsCache', function () use () {
$frontCache = new FrontData(
array(
"lifetime" => 172800
)
);
$cache = new BackFile(
$frontCache,
array(
"cacheDir" => $directory,
)
);
return $cache;
}
Now I would like to disable this during development and for automated testing. I use the ORM caching in the form:
MyObject::find(array(
'id != :id:',
'bind' => array(
'id' => $id,
),
'cache' => array(
'key' => 'my_cache_key',
'lifetime' => 3600,
),
))
If I simply omit adding the cache component to the dependency injection container, the cache component will complain as soon as I call a find method with the cache key.
The logged error is:
Service 'modelsCache' wasn't found in the dependency injection container
So, how can I disable the Cache? Anyway of stubbing the Backend Cache? I know that I could create a dummy Backend Cache component that implements the BackendInterface, but I figured that there must be a way of disabling the cache.