summaryrefslogtreecommitdiff
path: root/modules/tag/models
diff options
context:
space:
mode:
authorChad Kieffer <ckieffer@gmail.com>2009-07-25 09:25:31 -0600
committerChad Kieffer <ckieffer@gmail.com>2009-07-25 09:25:31 -0600
commiteca46d76a7832f771d377edb3939ea1aded2fac9 (patch)
treed4f0323202c7eb6eab60ff6e14f9905b625e349b /modules/tag/models
parent63511316be51f193d37c4f3b9dd3455a9ab60de8 (diff)
parent50d6cc0150b930d79d3e8b90956ffa9655fcc9c5 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/tag/models')
-rw-r--r--modules/tag/models/tag.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php
index 7a85dbab..e910a8ee 100644
--- a/modules/tag/models/tag.php
+++ b/modules/tag/models/tag.php
@@ -44,10 +44,14 @@ class Tag_Model extends ORM {
* @return integer
*/
public function items_count($type=null) {
- return ORM::factory("item")
+ $model = ORM::factory("item")
->viewable()
->join("items_tags", "items.id", "items_tags.item_id")
- ->where("items_tags.tag_id", $this->id)
- ->count_all();
+ ->where("items_tags.tag_id", $this->id);
+
+ if ($type) {
+ $model->where("items.type", $type);
+ }
+ return $model->count_all();
}
} \ No newline at end of file