/** * @return \Model\Db\Mysql */ public function getDb() { if (isset($GLOBALS['db'])) { // very dirty hack!!! $this->db = $GLOBALS['db']; } else { $this->db = Model::getDb($this->dbAdapterName); } return $this->db; }