Ejemplo n.º 1
0
 /**
  * Returns the database connection used by this AR class.
  * By default, the "db" application component is used as the database connection.
  *
  * @return Connection the database connection used by this AR class.
  */
 public static function getDb()
 {
     if (empty(self::$_db)) {
         self::$_db = Application::$app->getDb();
     }
     return self::$_db;
 }