实例化一次
单例模式无法new $db = new Database();
单例模式-> $db = Database::getInstance();
Database.php
class Database{
protected $db;
private function __construct(){
}
static function getInstance(){
if(self::$db){
return self::$db;
}else{
self::$db = new self();
return self::$db;
}
}
function where($where){
return $this;
}
function limit($limit){
return $this;
}
function order($order){
return $this;
}
}