Skip to content
Permalink
Browse files

Making target alias more extensible

  • Loading branch information...
Patrick Conroy
Patrick Conroy committed Jun 24, 2015
1 parent 44fbc41 commit 223830378b795c8f7a405f037f9fd426273355eb
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/ORM/Marshaller.php
@@ -287,6 +287,7 @@ protected function _belongsToMany(Association $assoc, array $data, $options = []
$records = [];
$conditions = [];
$primaryCount = count($primaryKey);
$target = $assoc->target();
foreach ($data as $i => $row) {
if (!is_array($row)) {
@@ -296,7 +297,7 @@ protected function _belongsToMany(Association $assoc, array $data, $options = []
$keys = array_intersect_key($row, $primaryKey);
if (count($keys) === $primaryCount) {
foreach ($keys as $key => $value) {
$conditions[][$assoc->alias() . '.' . $key] = $value;
$conditions[][$target->aliasfield($key)] = $value;
}
}
} else {

0 comments on commit 2238303

Please sign in to comment.
You can’t perform that action at this time.