Pop\Db\Adapter\Sqlsrv::__construct PHP Метод

__construct() публичный Метод

Instantiate the SQLSrv database connection object.
public __construct ( array $options ) : Sqlsrv
$options array
Результат Sqlsrv
    public function __construct(array $options)
    {
        if (!isset($options['database']) || !isset($options['host']) || !isset($options['username']) || !isset($options['password'])) {
            throw new Exception('Error: The proper database credentials were not passed.');
        }
        $this->connection = sqlsrv_connect($options['host'], array('Database' => $options['database'], 'UID' => $options['username'], 'PWD' => $options['password'], 'ReturnDatesAsStrings' => isset($options['ReturnDatesAsStrings']) ? $options['ReturnDatesAsStrings'] : true));
        if ($this->connection == false) {
            throw new Exception('Error: Could not connect to database. ' . PHP_EOL . $this->getErrors());
        }
        $this->database = $options['database'];
    }