Skip to content

Commit

Permalink
Update documentation on caching
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Jun 6, 2020
1 parent 851b043 commit ab89334
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/en/reference/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ the default cache instance:
new QueryCacheProfile(0, "some key", $cache);

In order for the data to actually be cached its necessary to ensure that the entire
result set is read (the easiest way to ensure this is to use ``fetchAll``) and the statement
object is closed:
result set is read (the easiest way to ensure this is to use one of the ``fetchAll*()`` methods):

::

<?php
$stmt = $conn->executeCacheQuery($query, $params, $types, new QueryCacheProfile(0, "some key"));
$data = $stmt->fetchAllAssociative();
$stmt->closeCursor(); // at this point the result is cached

.. warning::

Expand Down

0 comments on commit ab89334

Please sign in to comment.