diff --git a/README.md b/README.md index 4e640f5..bb88dd7 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,13 @@ class testModel extends Model{ } ``` -you can tag, retag, detag, untag, by id +you can categorize, recategorize, decategorize, uncategorize, by id ``` php -testModel->tagId(1); -testModel->untagId(1); -testModel->retagId(2); -testModel->detagId(2); +testModel->categorize(1); +testModel->recategorize(1); +testModel->decategorize(0); +testModel->uncategorize(2); ``` alse use id find Model (get model) diff --git a/src/Categorizable.php b/src/Categorizable.php index 4ed2cb4..42c02ff 100644 --- a/src/Categorizable.php +++ b/src/Categorizable.php @@ -19,11 +19,16 @@ public function categorize($categories) return $this->tag($categories); } - public function decategorize($categories) + public function uncategorize($categories) { return $this->untag($categories); } + public function decategorize($categories) + { + return $this->detag($categories); + } + public function recategorize($categories) { return $this->retag($categories); diff --git a/tests/CategoryTest.php b/tests/CategoryTest.php index 6ab4b17..bf2836f 100644 --- a/tests/CategoryTest.php +++ b/tests/CategoryTest.php @@ -70,7 +70,7 @@ public function testCategorizeByManyId() public function testCategoryUnTagId() { $this->testModel->categorize([1,2,3]); - $this->testModel->decategorize(1); + $this->testModel->uncategorize(1); $this->assertEquals( "2,3", $this->testModel->tagList @@ -90,7 +90,7 @@ public function testCategoryReTagId() public function testCategoryDeTagId() { $this->testModel->categorize(1); - $this->testModel->decategorize(1); + $this->testModel->uncategorize(1); $this->assertEquals( "", $this->testModel->tagList