Skip to content

Commit bb11e0e

Browse files
committed
- RunnableSelect: Added default-value for $className to 'stdClass' for the methods fetchObject, fetchObjects and fetchObjectsLazy
1 parent 7920386 commit bb11e0e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Builder/RunnableSelect.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function fetchRow(Closure $callback = null) {
9191
* @return object[]
9292
* @throws \Exception
9393
*/
94-
public function fetchObjects($className, Closure $callback = null) {
94+
public function fetchObjects($className = 'stdClass', Closure $callback = null) {
9595
return $this->fetchAll($callback, PDO::FETCH_CLASS, $className);
9696
}
9797

@@ -100,7 +100,7 @@ public function fetchObjects($className, Closure $callback = null) {
100100
* @param Closure $callback
101101
* @return object[]|Generator
102102
*/
103-
public function fetchObjectsLazy($className, Closure $callback = null) {
103+
public function fetchObjectsLazy($className = 'stdClass', Closure $callback = null) {
104104
return $this->fetchLazy($callback, PDO::FETCH_CLASS, $className);
105105
}
106106

@@ -110,7 +110,7 @@ public function fetchObjectsLazy($className, Closure $callback = null) {
110110
* @return object[]
111111
* @throws \Exception
112112
*/
113-
public function fetchObject($className, Closure $callback = null) {
113+
public function fetchObject($className = 'stdClass', Closure $callback = null) {
114114
return $this->fetch($callback, PDO::FETCH_CLASS, $className, function ($row) {
115115
return ['valid' => is_object($row), 'default' => null];
116116
});

0 commit comments

Comments
 (0)