public function listUser($start = 0, $nb = 20) { $start = intval($start); $nb = intval($nb); $sql = "SELECT * FROM user LIMIT {$start}, {$nb}"; return $this->daoTemplate->queryForList($sql, new UserRowMapper(), null); }
/** * Return the id of all categories below the id parent give in parameter * this function scan recursively to get all children (and chidren of children and etc...) **/ public function listIdCategoriesForParent($idParent) { $sql = "SELECT id FROM category WHERE idParent=:idParent"; $params[':idParent'] = $idParent; $idz = $this->daoTemplate->queryForList($sql, null, $params); foreach ($idz as $id) { $idz = array_merge($idz, $this->listIdCategoriesForParent($id)); } return $idz; }
public function listAll() { $sql = "SELECT * FROM role"; return $this->daoTemplate->queryForList($sql, new RoleRowMapper(), null); }