/** * 构造函数 */ private function __construct($table) { if (!isset($table)) { throw new Exception("you need to specify the table name for this DB model"); } if (self::$_db === null) { self::$_db = WF_Com_Db_PDO::Instance(); } $this->table = $table; }
private function _getUserByName($username) { $username = $this->_model->escape($username); //Todo model 应该有一个 fetchOne return $this->_model->fetch("where username = {$username}"); }