summaryrefslogtreecommitdiff
path: root/core/controllers/welcome.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-24 23:18:32 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-24 23:18:32 +0000
commitf81a9879be6fd50fd26d9dd2bc1c90e87763f7a8 (patch)
tree9cebf5ba21539d11dc74ff07d9299031cf64509b /core/controllers/welcome.php
parent75d9a829d794c727ff526deb07ad272faac4380d (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/controllers/welcome.php')
-rw-r--r--core/controllers/welcome.php9
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);
}
}