summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-23 18:00:44 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-23 18:00:44 +0000
commitab20406ef21c1011c2a4b189e8340dc7ee87a813 (patch)
tree76c41946b86675f42d56e03350605fc49923d61c /core
parent7491e3c44affb89fe28030f8759283bc1b4aa291 (diff)
Tag module database definitions
Diffstat (limited to 'core')
-rw-r--r--core/models/item.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/models/item.php b/core/models/item.php
index 4481a3a9..ba759c2b 100644
--- a/core/models/item.php
+++ b/core/models/item.php
@@ -21,6 +21,13 @@ class Item_Model extends ORM_MPTT {
protected $children = 'items';
protected $has_one = array("owner" => "user");
+ function __construct($id=null) {
+ parent::__construct($id);
+ if (!in_array("tags", $this->has_and_belongs_to_many) && module::is_installed("tag")) {
+ $this->has_and_belongs_to_many[] = "tags";
+ }
+ }
+
/**
* Is this item an album?
* @return true if it's an album