public function __construct($options = null)
{
if (!isset($options['db']) || !$options['db'] instanceof DbAdapter) {
throw new Exception('Parameter "db" is required and it must be an instance of Phalcon\\Db\\AdapterInterface');
}
$this->connection = $options['db'];
unset($options['db']);
if (!isset($options['table']) || empty($options['table']) || !is_string($options['table'])) {
throw new Exception("Parameter 'table' is required and it must be a non empty string");
}
$columns = ['session_id', 'data', 'created_at', 'modified_at'];
foreach ($columns as $column) {
$oColumn = "column_{$column}";
if (!isset($options[$oColumn]) || !is_string($options[$oColumn]) || empty($options[$oColumn])) {
$options[$oColumn] = $column;
}
}
parent::__construct($options);
session_set_save_handler([$this, 'open'], [$this, 'close'], [$this, 'read'], [$this, 'write'], [$this, 'destroy'], [$this, 'gc']);
}