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'];
}