Skip to content

Commit 2acd88a

Browse files
authored
Better tagging docs (#37)
1 parent 00018f4 commit 2acd88a

File tree

2 files changed

+8
-58
lines changed

2 files changed

+8
-58
lines changed

docs/index.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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

docs/tagging.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)