diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-24 14:00:07 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-24 14:00:07 -0800 |
commit | cc79abd0af83fdde471031b0629e8c7b0318790d (patch) | |
tree | 5c85d4d0aadd2d090e8009a4694e2058a628142c /modules/tag/helpers | |
parent | ca5f625a5e3dc2fc26136b5dea8f27251f92c7c4 (diff) |
Simplify tag::add().
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r-- | modules/tag/helpers/tag.php | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index 9e59b527..a500be58 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -37,17 +37,11 @@ class tag_Core { if (!$tag->loaded()) { $tag->name = $tag_name; $tag->count = 0; - $tag->save(); } - if (!$tag->has($item)) { - if (!$tag->add($item)) { - throw new Exception("@todo {$tag->name} WAS_NOT_ADDED_TO {$item->id}"); - } - $tag->count++; - $tag->save(); - } - return $tag; + $tag->add($item); + $tag->count++; + return $tag->save(); } /** |