Skip to content

Commit 5a10761

Browse files
committed
Merge pull request #1 from rsanchez/master
Add support for PDO::FETCH_OBJ fetchMode
2 parents 42862c3 + 66a13d6 commit 5a10761

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/Illuminate/CodeIgniter/CodeIgniterConnection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public function fetchResult($result)
108108
switch ($fetchMode) {
109109
case PDO::FETCH_ASSOC:
110110
return $result->result_array();
111+
case PDO::FETCH_OBJ:
112+
return $result->result();
111113
}
112114

113115
throw new \BadMethodCallException("Unsupported fetch mode '$fetchMode'.");

src/Illuminate/CodeIgniter/FakePDO.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
interface FakePDO
99
{
1010
const FETCH_ASSOC = 2;
11+
const FETCH_OBJ = 5;
1112
}

tests/Illuminate/CodeIgniter/FakePDOTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ class FakePDOTest extends \PHPUnit_Framework_TestCase
99
public function testConstants()
1010
{
1111
$this->assertSame(2, FakePDO::FETCH_ASSOC);
12+
$this->assertSame(5, FakePDO::FETCH_OBJ);
1213
}
1314
}

0 commit comments

Comments
 (0)