mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Return a more descriptive error when query result class is not found
This commit is contained in:
parent
32621dd34e
commit
86214cb0fa
1 changed files with 6 additions and 2 deletions
|
|
@ -526,8 +526,12 @@ class DB
|
|||
$result = array();
|
||||
$index = $last_index;
|
||||
$step = $last_index !== 0 ? -1 : 1;
|
||||
|
||||
while ($row = $stmt->fetchObject($result_class ?: 'stdClass'))
|
||||
$result_class = ($result_class && $result_class !== 'master') ? $result_class : 'stdClass';
|
||||
if (!class_exists($result_class))
|
||||
{
|
||||
throw new Exceptions\DBError('Class not found: ' . $result_class);
|
||||
}
|
||||
while ($row = $stmt->fetchObject($result_class))
|
||||
{
|
||||
$result[$index] = $row;
|
||||
$index += $step;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue