Pop\Db\Db::__construct PHP 메소드

__construct() 공개 메소드

Instantiate the database connection object.
public __construct ( string $type, array $options, string $prefix = 'Pop\Db\Adapter\' ) : Db
$type string
$options array
$prefix string
리턴 Db
    public function __construct($type, array $options, $prefix = 'Pop\\Db\\Adapter\\')
    {
        $this->isPdo = strtolower($type) == 'pdo';
        $class = $prefix . ucfirst(strtolower($type));
        if (!class_exists($class)) {
            throw new Exception('Error: That database adapter class does not exist.');
        }
        $this->adapter = new $class($options);
    }