diff --git a/docs/en/reference/caching.rst b/docs/en/reference/caching.rst index 04370bb4ca0..a541604da43 100644 --- a/docs/en/reference/caching.rst +++ b/docs/en/reference/caching.rst @@ -1,8 +1,8 @@ Caching ======= -Doctrine provides cache drivers in the ``Common`` package for some -of the most popular caching implementations such as APC, Memcache +Doctrine provides cache drivers in the ``doctrine/cache`` package for some +of the most popular caching implementations such as APCu, Memcache and Xcache. We also provide an ``ArrayCache`` driver which stores the data in a PHP array. Obviously, when using ``ArrayCache``, the cache does not persist between requests, but this is useful for @@ -306,7 +306,7 @@ the result cache. createQuery('select u from \Entities\User u'); - $query->useResultCache(true); + $query->enableResultCache(); You can also configure an individual query to use a different result cache driver. @@ -317,19 +317,18 @@ result cache driver. $cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( '/path/to/writable/directory' ); - $config = new \Doctrine\ORM\Configuration(); $query->setResultCacheDriver($cacheDriver); .. note:: Setting the result cache driver on the query will automatically enable the result cache for the query. If you want to - disable it pass false to ``useResultCache()``. + disable it use ``disableResultCache()``. :: useResultCache(false); + $query->disableResultCache(); If you want to set the time the cache has to live you can use the @@ -350,12 +349,12 @@ yourself with the ``setResultCacheId()`` method. $query->setResultCacheId('my_custom_id'); You can also set the lifetime and cache ID by passing the values as -the second and third argument to ``useResultCache()``. +the first and second argument to ``enableResultCache()``. .. code-block:: php useResultCache(true, 3600, 'my_custom_id'); + $query->enableResultCache(3600, 'my_custom_id'); Metadata Cache ~~~~~~~~~~~~~~