Skip to content

Commit 377b04c

Browse files
author
FreedomKnight
committed
rename method
1 parent b5241ff commit 377b04c

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ class testModel extends Model{
3939
}
4040
```
4141

42-
you can tag, retag, detag, untag, by id
42+
you can categorize, recategorize, decategorize, uncategorize, by id
4343

4444
``` php
45-
testModel->tagId(1);
46-
testModel->untagId(1);
47-
testModel->retagId(2);
48-
testModel->detagId(2);
45+
testModel->categorize(1);
46+
testModel->recategorize(1);
47+
testModel->decategorize(0);
48+
testModel->uncategorize(2);
4949
```
5050

5151
alse use id find Model (get model)

src/Categorizable.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ public function categorize($categories)
1919
return $this->tag($categories);
2020
}
2121

22-
public function decategorize($categories)
22+
public function uncategorize($categories)
2323
{
2424
return $this->untag($categories);
2525
}
2626

27+
public function decategorize($categories)
28+
{
29+
return $this->detag($categories);
30+
}
31+
2732
public function recategorize($categories)
2833
{
2934
return $this->retag($categories);

tests/CategoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testCategorizeByManyId()
7070
public function testCategoryUnTagId()
7171
{
7272
$this->testModel->categorize([1,2,3]);
73-
$this->testModel->decategorize(1);
73+
$this->testModel->uncategorize(1);
7474
$this->assertEquals(
7575
"2,3",
7676
$this->testModel->tagList
@@ -90,7 +90,7 @@ public function testCategoryReTagId()
9090
public function testCategoryDeTagId()
9191
{
9292
$this->testModel->categorize(1);
93-
$this->testModel->decategorize(1);
93+
$this->testModel->uncategorize(1);
9494
$this->assertEquals(
9595
"",
9696
$this->testModel->tagList

0 commit comments

Comments
 (0)