mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #11825 from cakephp/dereuromark-patch-2
Fix notice when passing false.
This commit is contained in:
commit
d63c847b61
1 changed files with 18 additions and 16 deletions
|
@ -1566,23 +1566,25 @@ class DboSource extends DataSource {
|
||||||
// Make one pass through children and collect by parent key
|
// Make one pass through children and collect by parent key
|
||||||
// Make second pass through parents and associate children
|
// Make second pass through parents and associate children
|
||||||
$mergedByFK = array();
|
$mergedByFK = array();
|
||||||
foreach ($assocResultSet as $data) {
|
if (is_array($assocResultSet)) {
|
||||||
$fk = $data[$association][$foreignKey];
|
foreach ($assocResultSet as $data) {
|
||||||
if (! array_key_exists($fk, $mergedByFK)) {
|
$fk = $data[$association][$foreignKey];
|
||||||
$mergedByFK[$fk] = array();
|
if (! array_key_exists($fk, $mergedByFK)) {
|
||||||
}
|
$mergedByFK[$fk] = array();
|
||||||
if (count($data) > 1) {
|
}
|
||||||
$data = array_merge($data[$association], $data);
|
if (count($data) > 1) {
|
||||||
unset($data[$association]);
|
$data = array_merge($data[$association], $data);
|
||||||
foreach ($data as $key => $name) {
|
unset($data[$association]);
|
||||||
if (is_numeric($key)) {
|
foreach ($data as $key => $name) {
|
||||||
$data[$association][] = $name;
|
if (is_numeric($key)) {
|
||||||
unset($data[$key]);
|
$data[$association][] = $name;
|
||||||
}
|
unset($data[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$mergedByFK[$fk][] = $data;
|
||||||
|
} else {
|
||||||
|
$mergedByFK[$fk][] = $data[$association];
|
||||||
}
|
}
|
||||||
$mergedByFK[$fk][] = $data;
|
|
||||||
} else {
|
|
||||||
$mergedByFK[$fk][] = $data[$association];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue