Skip to content

Commit

Permalink
Use more efficient array_map invocation.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 15, 2016
1 parent 0421d5c commit 756538e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ORM/Marshaller.php
Expand Up @@ -380,9 +380,7 @@ protected function _loadAssociatedByIds($assoc, $ids)
$target = $assoc->target();
$primaryKey = (array)$target->primaryKey();
$multi = count($primaryKey) > 1;
$primaryKey = array_map(function ($key) use ($target) {
return $target->alias() . '.' . $key;
}, $primaryKey);
$primaryKey = array_map([$target, 'aliasField'], $primaryKey);

if ($multi) {
if (count(current($ids)) !== count($primaryKey)) {
Expand Down

0 comments on commit 756538e

Please sign in to comment.