public function __construct($model) { $prefix = get_instance()->container->param('ikantam.theme.table.prefix'); $themesTable = $prefix . 'themes'; $this->table = $table = $prefix . $this->table; $this->_joins = array("theme" => "INNER JOIN `{$themesTable}` ON `{$table}`.`theme_id` `{$themesTable}`.`id`"); $this->_rules = array('theme_name' => array('theme' => "`{$themesTable}`.`name`")); $this->_select = array(); parent::__construct($model); }
public function __construct($model) { $prefix = get_instance()->container->param('ikantam.theme.table.prefix'); $this->table = $table = $prefix . $this->table; $themesTable = $prefix . 'themes'; $layoutsTable = $prefix . 'layouts'; $templatesTable = $prefix . 'templates'; $this->_joins = array('template' => "INNER JOIN `{$templatesTable}` ON `{$table}`.`template_id` = `{$templatesTable}`.`id`", 'layout' => array('template' => "INNER JOIN `{$layoutsTable}` ON " . "`{$layoutsTable}`.`id` = `{$templatesTable}`.`layout_id`"), 'theme' => array('layout' => "INNER JOIN `{$themesTable}` ON " . "`{$themesTable}`.`id` = `{$layoutsTable}`.`theme_id`")); $this->_rules = array('layout_id' => array('layout' => "`{$layoutsTable}`.`id`"), 'theme_id' => array('theme' => "`{$themesTable}`.`id`"), 'layout_name' => array('layout' => "`{$layoutsTable}`.`name`"), 'template_name' => array('template' => "`{$templatesTable}`.`name`"), 'theme_name' => array('theme' => "`{$themesTable}`.`name`")); $this->_select = array(); parent::__construct($model); }