public function templatemap() { $col_name = $this->_prefix . "templatemap_id"; $templatemap = null; if (isset($this->{$col_name}) && is_numeric($this->{$col_name}) && $this->{$col_name} > 0) { $templatemap_id = $this->{$col_name}; $templatemap = $this->load_cache($this->_prefix . ":" . $this->id . ":templatemap:" . $templatemap_id); if (empty($templatemap)) { require_once 'class.mt_templatemap.php'; $templatemap = new TemplateMap(); $templatemap->Load("templatemap_id = {$templatemap_id}"); $this->cache($this->_prefix . ":" . $this->id . ":templatemap:" . $templatemap->id, $templatemap); } } return $templatemap; }
public function fetch_templatemap($args = null) { if (isset($args['type'])) { $type_filter = 'and templatemap_archive_type = \'' . $this->escape($args['type']) . '\''; } if (isset($args['blog_id'])) { $blog_filter = 'and templatemap_blog_id = ' . intval($args['blog_id']); } $where = "1 = 1\n {$blog_filter}\n {$type_filter}\n order by templatemap_archive_type"; require_once 'class.mt_templatemap.php'; $tmap = new TemplateMap(); $result = $tmap->Find($where); return $result; }