Gdn::database PHP 메소드

database() 공개 정적인 메소드

Get a reference to the default database object.
public static database ( ) : Gdn_Database
리턴 Gdn_Database
    public static function database()
    {
        return self::factory(self::AliasDatabase);
    }

Usage Example

예제 #1
0
 protected function _GetData()
 {
     $Px = Gdn::database()->DatabasePrefix;
     $Sql = "show table status where Name in ('{$Px}User', '{$Px}Discussion', '{$Px}Comment')";
     $Result = array('User' => 0, 'Discussion' => 0, 'Comment' => 0);
     foreach ($Result as $Name => $Value) {
         $Result[$Name] = $this->getCount($Name);
     }
     $this->setData('Totals', $Result);
 }
All Usage Examples Of Gdn::database