Skip to content

Commit

Permalink
PDO::FETCH_ASSOC fetch style added to the Statement class
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Apr 7, 2021
1 parent 30f2ccd commit 86d0889
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sparqlClient/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public function fetch(int $fetchStyle = PDO::FETCH_OBJ): object | array | false
switch ($fetchStyle) {
case PDO::FETCH_OBJ:
return $row;
case PDO::FETCH_ASSOC:
return (array) $row;
case PDO::FETCH_COLUMN:
$row = get_object_vars($row);
return $row[array_keys($row)[0]];
Expand Down

0 comments on commit 86d0889

Please sign in to comment.