Example #1
0
 /**
  * Loads the config from the database.
  */
 public function loadConfigFromDatabase()
 {
     $configs = $this->db->select(array('key', 'value'))->from('config')->where(array('autoload' => 1))->execute()->fetchRows();
     foreach ($configs as $config) {
         $this->configData[$config['key']]['value'] = $config['value'];
         $this->configData[$config['key']]['autoload'] = 1;
     }
 }
Example #2
0
 /**
  * Gets the menu for the given id.
  *
  * @param int $menuId
  *
  * @return \Ilch\Layout\Helper\Menu\Model
  */
 public function getMenu($menuId)
 {
     $menu = new \Ilch\Layout\Helper\Menu\Model($this->layout);
     $menuRow = $this->db->select(array('id', 'title'))->from('menu')->where(array('id' => $menuId))->execute()->fetchAssoc();
     $menu->setId($menuRow['id']);
     $menu->setTitle($menuRow['title']);
     return $menu;
 }