Commit 08735910 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge pull request #74 from soulii/master

Portability column forced to lowercase
parents 67985484 89cbfdd7
...@@ -46,7 +46,7 @@ class Connection extends \Doctrine\DBAL\Connection ...@@ -46,7 +46,7 @@ class Connection extends \Doctrine\DBAL\Connection
/** /**
* @var int * @var int
*/ */
private $case = \PDO::CASE_NATURAL; private $case;
public function connect() public function connect()
{ {
......
...@@ -118,7 +118,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement ...@@ -118,7 +118,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
$row = $this->fixRow($row, $row = $this->fixRow($row,
$this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM), $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM),
($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE) !is_null($this->case) && ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE)
); );
return $row; return $row;
...@@ -133,7 +133,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement ...@@ -133,7 +133,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
} }
$iterateRow = $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM); $iterateRow = $this->portability & (Connection::PORTABILITY_EMPTY_TO_NULL|Connection::PORTABILITY_RTRIM);
$fixCase = ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE); $fixCase = !is_null($this->case) && ($fetchStyle == PDO::FETCH_ASSOC || $fetchStyle == PDO::FETCH_BOTH) && ($this->portability & Connection::PORTABILITY_FIX_CASE);
if (!$iterateRow && !$fixCase) { if (!$iterateRow && !$fixCase) {
return $rows; return $rows;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment