Always return an array from CreateFromQuery unless specifically the first result is requested

develop
Sven Slootweg 11 years ago
parent 4efacc178b
commit 249284e488

@ -619,10 +619,14 @@ abstract class CPHPDatabaseRecordClass extends CPHPBaseClass
if($result)
{
if(count($result->data) == 1 || $first_only === true)
if($first_only === true)
{
return new static($result);
}
elseif(count($result->data) == 1)
{
return array(new static($result));
}
else
{
$result_array = array();

Loading…
Cancel
Save