Skip to content

Commit 0ea8161

Browse files
committed
minor #7451 Update cache_pools.rst (crislinu)
This PR was merged into the 3.2 branch. Discussion ---------- Update cache_pools.rst When retrieving an item from cache you have to use `getItem()` and not `get()` The `Psr\Cache\CacheItemPoolInterface` doesn't declare the `get` method Commits ------- 398892e Update cache_pools.rst
2 parents 848cabc + 398892e commit 0ea8161

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/cache/cache_pools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ item in the cache immediately (it returns ``true`` if the item was saved or
282282
``false`` if some error occurred)::
283283

284284
// ...
285-
$userFriends = $cache->get('user_'.$userId.'_friends');
285+
$userFriends = $cache->getItem('user_'.$userId.'_friends');
286286
$userFriends->set($user->getFriends());
287287
$isSaved = $cache->save($userFriends);
288288

0 commit comments

Comments
 (0)