1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace yii\db\mssql;
- class DBLibPDO extends \PDO
- {
-
-
- public function lastInsertId($name = null)
- {
- return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
- }
-
-
- public function getAttribute($attribute)
- {
- try {
- return parent::getAttribute($attribute);
- } catch (\PDOException $e) {
- switch ($attribute) {
- case self::ATTR_SERVER_VERSION:
- return $this->query("SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR)")->fetchColumn();
- default:
- throw $e;
- }
- }
- }
- }
|