本文整理匯總了PHP中DB::_instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP DB::_instance方法的具體用法?PHP DB::_instance怎麽用?PHP DB::_instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DB
的用法示例。
在下文中一共展示了DB::_instance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInstance
/**
* Возвращет единственный экземпляр данного класса.
* @return object - объект класса DB
*/
public static function getInstance()
{
if (is_null(self::$_instance)) {
self::$_instance = new self();
}
return self::$_instance;
}
示例2: getInstance
public static function getInstance()
{
if (!isset(self::$_instance)) {
self::$_instance = new DB();
}
return self::$_instance;
}
示例3: getInstance
public function getInstance()
{
if (self::$_instance === null) {
self::$_instance = new self();
}
return self::$_instance;
}
示例4: instance
/**
* 單例
* @return instance
*/
public static function instance()
{
if (self::$_instance === NULL) {
self::$_instance = new self();
}
return self::$_instance;
}
示例5: singleton
static function singleton()
{
if (!self::$_instance instanceof self) {
self::$_instance = new self();
}
return self::$_instance;
}
示例6: GetConn
public static function GetConn()
{
if (self::$_instance == null) {
self::$_instance = new Database();
}
return self::$_instance->GetConn();
}
示例7: unsetInstance
public static function unsetInstance()
{
self::getInstance()->type = NULL;
self::getInstance()->_adapter->closeConnection();
self::getInstance()->_adapter = NULL;
self::$_instance = NULL;
}
示例8: getInstance
protected static function getInstance()
{
if (!self::$_instance instanceof self) {
self::$_instance = new self();
}
return self::$_instance;
}
示例9: getInstance
public static function getInstance()
{
if (null === self::$_instance) {
self::$_instance = new DB(Config::get('db.host'), Config::get('db.user'), Config::get('db.password'), Config::get('db.db_name'));
}
return self::$_instance;
}
示例10: singleton
/**
* M�todo que se usa para obtener una �nica instancia del objeto DB.
* Si dicha instancia no existe, la crea. Una vez creada la devuelve.
*
* @return DB Instancia del objeto DB
*/
public static function singleton()
{
if (self::$_instance == null) {
self::$_instance = new self();
}
return self::$_instance;
}
示例11: instance
/**
* Singleton initial.
*/
public static function instance()
{
if (empty(self::$_instance) === true) {
self::$_instance = new self();
}
return self::$_instance;
}
示例12: instance
public static function instance($reset = false)
{
if (!isset(self::$_instance) || $reset) {
self::$_instance = new DB();
}
return self::$_instance;
}
示例13: getInstance
public static function getInstance()
{
if (!isset(self::$_instance) || get_class(self::$_instance) !== 'DB') {
self::$_instance = new DB();
}
return self::$_instance;
}
示例14: _getInstance
public static function _getInstance()
{
if (!self::$_instance instanceof self) {
self::$_instance = new self();
}
return self::$_instance;
}
示例15: connect
public static function connect()
{
if (!isset(self::$_instance)) {
self::$_instance = new self();
}
return self::$_instance;
}