lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php 1 location
|
@@ 43-53 (lines=11) @@
|
| 40 |
|
/** |
| 41 |
|
* {@inheritDoc} |
| 42 |
|
*/ |
| 43 |
|
public function lastInsertId($name = null) |
| 44 |
|
{ |
| 45 |
|
if (null === $name) { |
| 46 |
|
return parent::lastInsertId($name); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
$stmt = $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?'); |
| 50 |
|
$stmt->execute([$name]); |
| 51 |
|
|
| 52 |
|
return $stmt->fetchColumn(); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
/** |
| 56 |
|
* {@inheritDoc} |
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php 1 location
|
@@ 133-143 (lines=11) @@
|
| 130 |
|
/** |
| 131 |
|
* {@inheritDoc} |
| 132 |
|
*/ |
| 133 |
|
public function lastInsertId($name = null) |
| 134 |
|
{ |
| 135 |
|
if ($name !== null) { |
| 136 |
|
$stmt = $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?'); |
| 137 |
|
$stmt->execute([$name]); |
| 138 |
|
|
| 139 |
|
return $stmt->fetchColumn(); |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
return $this->lastInsertId->getId(); |
| 143 |
|
} |
| 144 |
|
|
| 145 |
|
/** |
| 146 |
|
* {@inheritDoc} |