<?php
/********************************************************************************
 * (c)1337 aheadware.com - All rights reserved
 ********************************************************************************/

/**
 * Class ADHMN_Db_Admin
 */
class AHDMN_Db_Admin
{

    // Singleton pattern
    protected static $dbh = NULL;
    private function __construct() {}
    private function __clone() {}

    /**
     * Get single DB instance
     *
     * @return Francis_Db_MySql|null
     */
    public static function get() {
        if ( is_null( self::$dbh ) ) {
            self::$dbh = new AHDB_Db_PDO(array(
                'host' => AHDMN_Core_Config::get( 'db.admin.host' ),
                'name' => AHDMN_Core_Config::get( 'db.admin.name' ),
                'user' => AHDMN_Core_Config::get( 'db.admin.user' ),
                'pass' => AHDMN_Core_Config::get( 'db.admin.pass' )
            ));
        }
        return self::$dbh;
    }
} 