setAttribute(PDO::ATTR_STATEMENT_CLASS, [Statement::class, []]); } /** * {@inheritDoc} */ public function lastInsertId($name = null) { if ($name === null) { return parent::lastInsertId($name); } $stmt = $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?'); $stmt->execute([$name]); return $stmt->fetchColumn(); } /** * {@inheritDoc} */ public function quote($value, $type = ParameterType::STRING) { $val = parent::quote($value, $type); // Fix for a driver version terminating all values with null byte if (strpos($val, "\0") !== false) { $val = substr($val, 0, -1); } return $val; } }