Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
FreedomKnight committed Feb 7, 2018
1 parent b5241ff commit 377b04c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion src/Categorizable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/CategoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 377b04c

Please sign in to comment.