public function getCategories() { $sql = new SqlStatement(); $sql->select(array('cd.name', 'id' => 'c.category_id', 'pid' => 'c.parent_id'))->from(array('c' => 'category'))->innerJoin(array('cd' => 'category_description'), 'c.category_id = cd.category_id')->where('cd.language_id = ?', (int) $this->config->get('config_language_id'))->order(array('c.parent_id', 'c.sort_order', 'LCASE(cd.name)')); $res = $this->db->query($sql); $output = array(); foreach ($res->rows as $row) { $output[$row['id']] = array('name' => $row['name'], 'pid' => $row['pid']); } return $output; }
protected static function _quote($i) { return "'" . SqlStatement::escape($i) . "'"; }
public function detectCategoryLayouts() { $sql = new SqlStatement(); $sql->select(array('layout_id'))->from('layout_route')->where('route = "product/category"'); $res = $this->db->query($sql); $output = array(); if ($res->num_rows) { foreach ($res->rows as $row) { $output[] = $row['layout_id']; } } return $output; }