From ab20406ef21c1011c2a4b189e8340dc7ee87a813 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 23 Nov 2008 18:00:44 +0000 Subject: Tag module database definitions --- core/models/item.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core/models') 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 -- cgit v1.2.3