Completed
Pull Request — master (#2)
by Joao
05:22
created

PdoDblib::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 10
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
crap 2
1
<?php
2
3
namespace ByJG\AnyDataset\Store;
4
5
class PdoDblib extends DbPdoDriver
6
{
7
8
    public function __construct($connUri)
9
    {
10
        $this->setSupportMultRowset(true);
11
12
        parent::__construct($connUri, null, null);
13
14
        // Solve the error:
15
        // SQLSTATE[HY000]: General error: 1934 General SQL Server error: Check messages from the SQL Server [1934] (severity 16) [(null)]
16
        // http://gullele.wordpress.com/2010/12/15/accessing-xml-column-of-sql-server-from-php-pdo/
17
        // http://stackoverflow.com/questions/5499128/error-when-using-xml-in-stored-procedure-pdo-ms-sql-2008
18
        $this->getDbConnection()->exec('SET QUOTED_IDENTIFIER ON');
19
        $this->getDbConnection()->exec('SET ANSI_WARNINGS ON');
20
        $this->getDbConnection()->exec('SET ANSI_PADDING ON');
21
        $this->getDbConnection()->exec('SET ANSI_NULLS ON');
22
        $this->getDbConnection()->exec('SET CONCAT_NULL_YIELDS_NULL ON');
23
    }
24
}
25