diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-24 23:18:32 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-24 23:18:32 +0000 |
commit | f81a9879be6fd50fd26d9dd2bc1c90e87763f7a8 (patch) | |
tree | 9cebf5ba21539d11dc74ff07d9299031cf64509b /core | |
parent | 75d9a829d794c727ff526deb07ad272faac4380d (diff) |
Moved the creation of tags into the tag helper library. Added a count field to the tags table. Bharat, I know you said not to worry about caching, but I want to explore what are some of the issues with keeping track of the counts as we go. (i.e. is it a pain in the a__)
Diffstat (limited to 'core')
-rw-r--r-- | core/controllers/welcome.php | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index a3e46214..9f42c1c4 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -245,14 +245,7 @@ class Welcome_Controller extends Template_Controller { $tag_name = $tags[array_rand($tags)]; $item = $items[array_rand($items)]; - $tag = ORM::factory("tag")->where("name", $tag_name)->find(); - if (!$tag->loaded) { - $tag->name = $tag_name; - $tag->save(); - } - if (!$tag->add($item, $tag)) { - throw new Exception("@todo {$tag->name} WAS_NOT_ADDED_TO {$item->id}"); - } + tag::add_tag($item, $tag_name); } } |