public function __construct($name = 'phalcon', array $options = [])
{
if (!isset($options['db'])) {
throw new Exception("Parameter 'db' is required");
}
if (!$options['db'] instanceof DbAdapterInterface) {
throw new Exception("Parameter 'db' must be object and implement AdapterInterface");
}
if (!isset($options['table'])) {
throw new Exception("Parameter 'table' is required");
}
$this->db = $options['db'];
if ($name) {
$this->name = $name;
}
$this->options = $options;
}