@@ -60,43 +60,43 @@ instantiate :class:`Symfony\\Component\\Cache\\Simple\\FilesystemCache`::
6060Now you can create, retrieve, update and delete items using this object::
6161
6262 // save a new item in the cache
63- $cache->set('stats.num_products ', 4711);
63+ $cache->set('stats.products_count ', 4711);
6464
6565 // or set it with a custom ttl
66- // $cache->set('stats.num_products ', 4711, 3600);
66+ // $cache->set('stats.products_count ', 4711, 3600);
6767
6868 // retrieve the cache item
69- if (!$cache->has('stats.num_products ')) {
69+ if (!$cache->has('stats.products_count ')) {
7070 // ... item does not exists in the cache
7171 }
7272
7373 // retrieve the value stored by the item
74- $numProducts = $cache->get('stats.num_products ');
74+ $productsCount = $cache->get('stats.products_count ');
7575
7676 // or specify a default value, if the key doesn't exist
77- // $numProducts = $cache->get('stats.num_products ', 100);
77+ // $productsCount = $cache->get('stats.products_count ', 100);
7878
7979 // remove the cache key
80- $cache->delete('stats.num_products ');
80+ $cache->delete('stats.products_count ');
8181
8282 // clear *all* cache keys
8383 $cache->clear();
8484
8585You can also work with multiple items at once::
8686
8787 $cache->setMultiple(array(
88- 'stats.num_products ' => 4711,
89- 'stats.num_users ' => 1356,
88+ 'stats.products_count ' => 4711,
89+ 'stats.users_count ' => 1356,
9090 ));
9191
9292 $stats = $cache->getMultiple(array(
93- 'stats.num_products ',
94- 'stats.num_users ',
93+ 'stats.products_count ',
94+ 'stats.users_count ',
9595 ));
9696
9797 $cache->deleteMultiple(array(
98- 'stats.num_products ',
99- 'stats.num_users ',
98+ 'stats.products_count ',
99+ 'stats.users_count ',
100100 ));
101101
102102Available Simple Cache (PSR-16) Classes
@@ -159,22 +159,22 @@ a filesystem-based cache, instantiate :class:`Symfony\\Component\\Cache\\Adapter
159159Now you can create, retrieve, update and delete items using this cache pool::
160160
161161 // create a new item by trying to get it from the cache
162- $numProducts = $cache->getItem('stats.num_products ');
162+ $productsCount = $cache->getItem('stats.products_count ');
163163
164164 // assign a value to the item and save it
165- $numProducts ->set(4711);
166- $cache->save($numProducts );
165+ $productsCount ->set(4711);
166+ $cache->save($productsCount );
167167
168168 // retrieve the cache item
169- $numProducts = $cache->getItem('stats.num_products ');
170- if (!$numProducts ->isHit()) {
169+ $productsCount = $cache->getItem('stats.products_count ');
170+ if (!$productsCount ->isHit()) {
171171 // ... item does not exists in the cache
172172 }
173173 // retrieve the value stored by the item
174- $total = $numProducts ->get();
174+ $total = $productsCount ->get();
175175
176176 // remove the cache item
177- $cache->deleteItem('stats.num_products ');
177+ $cache->deleteItem('stats.products_count ');
178178
179179For a list of all of the supported adapters, see :doc: `/components/cache/cache_pools `.
180180
0 commit comments