@@ -63,43 +63,43 @@ instantiate :class:`Symfony\\Component\\Cache\\Simple\\FilesystemCache`::
6363Now you can create, retrieve, update and delete items using this object::
6464
6565 // save a new item in the cache
66- $cache->set('stats.num_products ', 4711);
66+ $cache->set('stats.products_count ', 4711);
6767
6868 // or set it with a custom ttl
69- // $cache->set('stats.num_products ', 4711, 3600);
69+ // $cache->set('stats.products_count ', 4711, 3600);
7070
7171 // retrieve the cache item
72- if (!$cache->has('stats.num_products ')) {
72+ if (!$cache->has('stats.products_count ')) {
7373 // ... item does not exists in the cache
7474 }
7575
7676 // retrieve the value stored by the item
77- $numProducts = $cache->get('stats.num_products ');
77+ $productsCount = $cache->get('stats.products_count ');
7878
7979 // or specify a default value, if the key doesn't exist
80- // $numProducts = $cache->get('stats.num_products ', 100);
80+ // $productsCount = $cache->get('stats.products_count ', 100);
8181
8282 // remove the cache key
83- $cache->delete('stats.num_products ');
83+ $cache->delete('stats.products_count ');
8484
8585 // clear *all* cache keys
8686 $cache->clear();
8787
8888You can also work with multiple items at once::
8989
9090 $cache->setMultiple(array(
91- 'stats.num_products ' => 4711,
92- 'stats.num_users ' => 1356,
91+ 'stats.products_count ' => 4711,
92+ 'stats.users_count ' => 1356,
9393 ));
9494
9595 $stats = $cache->getMultiple(array(
96- 'stats.num_products ',
97- 'stats.num_users ',
96+ 'stats.products_count ',
97+ 'stats.users_count ',
9898 ));
9999
100100 $cache->deleteMultiple(array(
101- 'stats.num_products ',
102- 'stats.num_users ',
101+ 'stats.products_count ',
102+ 'stats.users_count ',
103103 ));
104104
105105Available Simple Cache (PSR-16) Classes
@@ -162,22 +162,22 @@ a filesystem-based cache, instantiate :class:`Symfony\\Component\\Cache\\Adapter
162162Now you can create, retrieve, update and delete items using this cache pool::
163163
164164 // create a new item by trying to get it from the cache
165- $numProducts = $cache->getItem('stats.num_products ');
165+ $productsCount = $cache->getItem('stats.products_count ');
166166
167167 // assign a value to the item and save it
168- $numProducts ->set(4711);
169- $cache->save($numProducts );
168+ $productsCount ->set(4711);
169+ $cache->save($productsCount );
170170
171171 // retrieve the cache item
172- $numProducts = $cache->getItem('stats.num_products ');
173- if (!$numProducts ->isHit()) {
172+ $productsCount = $cache->getItem('stats.products_count ');
173+ if (!$productsCount ->isHit()) {
174174 // ... item does not exists in the cache
175175 }
176176 // retrieve the value stored by the item
177- $total = $numProducts ->get();
177+ $total = $productsCount ->get();
178178
179179 // remove the cache item
180- $cache->deleteItem('stats.num_products ');
180+ $cache->deleteItem('stats.products_count ');
181181
182182For a list of all of the supported adapters, see :doc: `/components/cache/cache_pools `.
183183
0 commit comments