当前位置: 首页>>代码示例>>PHP>>正文


PHP Db::instance方法代码示例

本文整理汇总了PHP中Db::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::instance方法的具体用法?PHP Db::instance怎么用?PHP Db::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Db的用法示例。


在下文中一共展示了Db::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get

 public static function get()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:kucrut,项目名称:tt-rss,代码行数:7,代码来源:db.php

示例2: save

 public function save()
 {
     $db = Db::instance();
     // map database fields to class properties; omit id and dateCreated
     $db_properties = array('email' => $this->email, 'name' => $this->name);
     $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);
 }
开发者ID:malimu,项目名称:Pipeline,代码行数:7,代码来源:consent.class.php

示例3: getDbInstance

 public static function getDbInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new Db();
     }
     return self::$instance;
 }
开发者ID:shaffan1,项目名称:categoriesapp,代码行数:7,代码来源:db.php

示例4: getInstance

 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self(['database_type' => 'mysql', 'database_name' => 'notificador', 'server' => 'localhost', 'username' => 'root', 'password' => '', 'charset' => 'utf8']);
     }
     return self::$instance;
 }
开发者ID:ulissesvaquero,项目名称:slim-medoo-rest-api,代码行数:7,代码来源:db.php

示例5: singleton

 public static function singleton()
 {
     if (self::$instance == false) {
         self::$instance = new parent(Config::host, Config::username, Config::pass, Config::dbname);
     }
     return self::$instance;
 }
开发者ID:Adriangel,项目名称:omegame,代码行数:7,代码来源:Db.php

示例6: getInstance

 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new Db();
     }
     return self::$instance;
 }
开发者ID:riverspirit,项目名称:Overdose,代码行数:7,代码来源:db.class.php

示例7: save

 public function save()
 {
     $db = Db::instance();
     // map database fields to class properties; omit id and dateCreated
     $db_properties = array('description' => $this->description, 'group' => $this->group, 'css_class' => $this->cssClass, 'diffable' => $this->diffable, 'hidden' => $this->hidden, 'contribution' => $this->contribution);
     $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);
 }
开发者ID:malimu,项目名称:Pipeline,代码行数:7,代码来源:eventType.class.php

示例8: getInstance

 public static function getInstance()
 {
     if (Db::$instance == null) {
         Db::$instance = new Db();
     }
     return Db::$instance;
 }
开发者ID:jelek92,项目名称:lpStore,代码行数:7,代码来源:Db.php

示例9: getInstance

 /**
  *   Singleton
  */
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:pixelproduction,项目名称:PixelManagerCMS,代码行数:10,代码来源:Db.php

示例10: getInstance

 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
     }
     return self::$instance;
 }
开发者ID:bsack23,项目名称:mvc-hwredo,代码行数:7,代码来源:db.class.php

示例11: getInstance

 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new PDO('mysql:host=' . _DB_HOST_ . ';dbname=' . _DB_NAME_, _DB_USER_, _DB_PASS_, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
     }
     return self::$instance;
 }
开发者ID:ADcreatif,项目名称:wardieval,代码行数:7,代码来源:Db.class.php

示例12: save

 public function save()
 {
     $db = Db::instance();
     // map database fields to class properties; omit id and dateCreated
     $db_properties = array('user_id' => $this->userID, 'title' => $this->title, 'slug' => $this->slug);
     $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);
 }
开发者ID:malimu,项目名称:Pipeline,代码行数:7,代码来源:interest.class.php

示例13: getDBInstance

 public static function getDBInstance()
 {
     if (self::$instance == null) {
         self::$instance = self::initiatePDOObject();
     }
     return self::$instance;
 }
开发者ID:dvertovsek,项目名称:iOS-PHP-PostgreSQL-ChatApp,代码行数:7,代码来源:dbPDOController.php

示例14: getInstance

 static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = self::buildInstance();
     }
     return self::$instance;
 }
开发者ID:nicolaslattuada,项目名称:minimal-php-mvc,代码行数:7,代码来源:Db.php

示例15: getInstance

 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new Db(_DB_SERVER_NAME_, _DB_USER_NAME_, _DB_PASSWORD_, _DB_NAME_);
     }
     return self::$instance;
 }
开发者ID:ecuation,项目名称:Control-de-stock,代码行数:7,代码来源:Db.php


注:本文中的Db::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。