Instantiate class
public __construct ( $dsn, $user = NULL, $pw = NULL, array $options = NULL ) | ||
$dsn | string | |
$user | string | |
$pw | string | |
$options | array | array |
function __construct(array $options = NULL) { //set up connection $settings = \Base::instance()->get('db'); $dsn = 'mysql:host=' . $settings['host'] . ';port=' . $settings['port'] . ';dbname=' . $settings['dbname']; parent::__construct($dsn, $settings['user'], $settings['pw']); }
function __construct($dsn, $user = null, $pw = null, array $options = null) { parent::__construct($dsn, $user, $pw, $options); }