陈诗烁
2015-04-29 15:28
class Database{
static protected $db;
private function __construct(){
}
static function getInstance(){
echo 111;
if(self::$db){
return self::$db;
}else{
self::$db = new self();
return self::$db;
}
}
function where($where){
return $this;
}
function order($order){
return $this;
}
function limit($limit){
return $this;
}
}
是单粒不是单利
大话PHP设计模式
62257 学习 · 238 问题
相似问题