Skip to content

Commit

Permalink
Fixed LazyCustomerLoader::loadValuesForChoices implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeveloper committed Dec 22, 2017
1 parent 51891c3 commit 8efb3a1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ public function loadChoicesForValues(array $values, $value = null)
public function loadValuesForChoices(array $choices, $value = null)
{
$mapCustomerToEmail = function($customer){
if($customer == null){
return null;
}

return $customer->getEmail();
};

return array_map($mapCustomerToEmail, $choices);
}
}

0 comments on commit 8efb3a1

Please sign in to comment.