Skip to content

Commit

Permalink
Optimizing code for better performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
mylux committed Mar 17, 2015
1 parent 554b94e commit a20b319
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ORM/Marshaller.php
Expand Up @@ -112,8 +112,11 @@ public function one(array $data, array $options = [])
foreach ($primaryKey as $pkey) {
$record->where(["$pkey" => $data[$pkey] ]);
}
if ($record->count() > 0) {
return $record->first();

$record = $record->first();

if ($record) {
return $record;
}
}

Expand Down

0 comments on commit a20b319

Please sign in to comment.