DBLibPDO
API reference › yii › db › mssql › DBLibPDO
This is an extension of the default PDO class of DBLIB drivers.
It provides workarounds for improperly implemented functionalities of the DBLIB drivers.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getAttribute() | Retrieve a database connection attribute. | DBLibPDO |
lastInsertId() | Returns value of the last inserted ID. | DBLibPDO |
Method details
Section titled “Method details”getAttribute()
Section titled “getAttribute() ”public function getAttribute(int $attribute): mixedRetrieve a database connection attribute.
It is necessary to override PDO’s method as some MSSQL PDO driver (for example, dblib) does not support getting attributes.
Parameters
| Parameter | Type | Description |
|---|---|---|
$attribute | int | One of the PDO::ATTR_* constants. |
Returns
mixed: A successful call returns the value of the requested PDO attribute. An unsuccessful call returns null.
lastInsertId()
Section titled “lastInsertId() ”public function lastInsertId(string|null $name = null): string|falseReturns value of the last inserted ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string| | The sequence name. Defaults to null. |
Returns
string|false: Last inserted ID value.