public function getDb() { if (self::$__db === null) { self::$__db = Yaf_Registry::get('db'); $this->db = self::$__db; $this->db->open(); } return self::$__db; }