'templatecategory', self::TABLE_TYPE => 'templatetype', self::TABLE_GLOBAL => 'page', self::TABLE_USERPAGE => 'userpage', self::TABLE_PACKAGE => 'templatepackage', ); protected $belongs_to = array ('text'); protected $human_field_name = array ( 'title' => 'Title', 'content' => 'Content', ); protected $journal_name = 'Text Content'; function getJournalName () { $result = $this->text->getJournalName (); $result .= $this->getJournalContext (); return $result; } function getJournalContext () { if ($this->table == self::TABLE_GLOBAL) { return; } else { $text = ORM::factory ($this->corresponding_tables[$this->table], $this->table_id); return ' in ' . $text->getJournalName (); } } }