Skip to content

Commit

Permalink
Fixed a small issue when using dot notation for Table::save() options
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jun 15, 2014
1 parent a751d37 commit 3bc6c2a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ORM/Associations.php
Expand Up @@ -279,11 +279,9 @@ public function normalizeKeys($keys) {
$path = explode('.', $table);
$table = array_pop($path);
$first = array_shift($path);

if (isset($pointer[$first])) {
$pointer =& $pointer[$first];
$pointer += ['associated' => []];
}
$pointer += [$first => []];
$pointer =& $pointer[$first];
$pointer += ['associated' => []];

foreach ($path as $t) {
$pointer += ['associated' => []];
Expand All @@ -296,7 +294,7 @@ public function normalizeKeys($keys) {
$pointer['associated'][$table] = $options + $pointer['associated'][$table];
}

return $result;
return isset($result['associated']) ? $result['associated'] : $result;
}

}

0 comments on commit 3bc6c2a

Please sign in to comment.