File tree Expand file tree Collapse file tree 2 files changed +8
-58
lines changed Expand file tree Collapse file tree 2 files changed +8
-58
lines changed Original file line number Diff line number Diff line change @@ -94,14 +94,20 @@ $item->set('value')->setTags(['tag0', 'tag1'])
9494$pool->save($item);
9595
9696$item = $pool->getItem('aaron');
97- $item->set('value')->addTag( 'tag0');
97+ $item->set('value')->setTags([ 'tag0'] );
9898$pool->save($item);
9999
100100// Remove everything tagged with 'tag1'
101- $pool->clearTags (['tag1']);
101+ $pool->invalidateTags (['tag1']);
102102$pool->getItem('tobias')->isHit(); // false
103103$pool->getItem('aaron')->isHit(); // true
104104
105+ $item = $pool->getItem('aaron');
106+ echo $item->getPreviousTags(); // array('tag0')
107+
108+ // No tags will be saved again. This is the same as saving
109+ // an item with no tags.
110+ $pool->save($item);
105111```
106112
107113#### Hierarchy
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments