示例#1
0
 /**
  * @param array $config
  * @return JO_Db_Adapter_Abstract
  */
 public static function setAdapterConfig($config)
 {
     if (self::$dbAdapter == null) {
         require_once 'JO/Db/Exception.php';
         throw new JO_Db_Exception("Db adapter class is not loaded");
     }
     /*
      * Verify that the object created is a descendent of the abstract adapter type.
      */
     if (!self::$dbAdapter instanceof JO_Db_Adapter_Abstract) {
         /**
          * @see JO_Db_Exception
          */
         require_once 'JO/Db/Exception.php';
         throw new JO_Db_Exception("Adapter class does not extend JO_Db_Adapter_Abstract");
     }
     $adapterName = self::$dbAdapter_name;
     self::$dbAdapter = new $adapterName($config);
     return self::$dbAdapter;
 }