File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Upgrade to 2.7
22
3+ ## Added ` Doctrine\ORM\AbstractQuery#enableResultCache() ` and ` Doctrine\ORM\AbstractQuery#disableResultCache() ` methods
4+
5+ Method ` Doctrine\ORM\AbstractQuery#useResultCache() ` which could be used for both
6+ enabling and disabling the cache (depending on passed flag) was split into two.
7+
38## Deprecated: ` Doctrine\ORM\EntityManagerInterface#copy() `
49
510Method ` Doctrine\ORM\EntityManagerInterface#copy() ` never got its implementation and is deprecated.
611It will be removed in 3.0.
712
13+ ## Deprecated: ` Doctrine\ORM\AbstractQuery#useResultCache() `
14+
15+ Method ` Doctrine\ORM\AbstractQuery#useResultCache() ` is deprecated because it is split
16+ into ` enableResultCache() ` and ` disableResultCache() ` . It will be removed in 3.0.
17+
818# Upgrade to 2.6
919
1020## Added ` Doctrine\ORM\EntityRepository::count() ` method
Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ the result cache.
327327
328328 <?php
329329 $query = $em->createQuery('select u from \Entities\User u');
330- $query->useResultCache(true );
330+ $query->enableResultCache( );
331331
332332 You can also configure an individual query to use a different
333333result cache driver.
@@ -341,12 +341,12 @@ result cache driver.
341341
342342 Setting the result cache driver on the query will
343343 automatically enable the result cache for the query. If you want to
344- disable it pass false to `` useResultCache() ``.
344+ disable it, call `` disableResultCache ``.
345345
346346 ::
347347
348348 <?php
349- $query->useResultCache(false );
349+ $query->disableResultCache( );
350350
351351
352352If you want to set the time the cache has to live you can use the
@@ -367,12 +367,12 @@ yourself with the ``setResultCacheId()`` method.
367367 $query->setResultCacheId('my_custom_id');
368368
369369 You can also set the lifetime and cache ID by passing the values as
370- the second and third argument to ``useResultCache () ``.
370+ the first and second argument to ``enableResultCache () ``.
371371
372372.. code-block :: php
373373
374374 <?php
375- $query->useResultCache(true, 3600, 'my_custom_id');
375+ $query->enableResultCache( 3600, 'my_custom_id');
376376
377377 Metadata Cache
378378~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -1323,7 +1323,7 @@ Result Cache API:
13231323
13241324 $query->setResultCacheDriver(new ApcCache());
13251325
1326- $query->useResultCache(true )
1326+ $query->enableResultCache( )
13271327 ->setResultCacheLifeTime($seconds = 3600);
13281328
13291329 $result = $query->getResult(); // cache miss
@@ -1334,8 +1334,8 @@ Result Cache API:
13341334 $query->setResultCacheId('my_query_result');
13351335 $result = $query->getResult(); // saved in given result cache id.
13361336
1337- // or call useResultCache () with all parameters:
1338- $query->useResultCache(true, $seconds = 3600, 'my_query_result');
1337+ // or call enableResultCache () with all parameters:
1338+ $query->enableResultCache( $seconds = 3600, 'my_query_result');
13391339 $result = $query->getResult(); // cache hit!
13401340
13411341 // Introspection
Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ a querybuilder instance into a Query object:
330330
331331 // Set additional Query options
332332 $query->setQueryHint('foo', 'bar');
333- $query->useResultCache( 'my_cache_id');
333+ $query->enableResultCache($seconds = 3600, 'my_cache_id');
334334
335335 // Execute Query
336336 $result = $query->getResult();
You can’t perform that action at this time.
0 commit comments