本文整理汇总了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;
}