Skip to content

Commit

Permalink
Change parameter name to "forceTargetNew"
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaoh committed Jan 20, 2016
1 parent 910ce87 commit a005fa6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ORM/Marshaller.php
Expand Up @@ -125,8 +125,8 @@ public function one(array $data, array $options = [])
}

$marshallOptions = [];
if (isset($options['forceTargetSave'])) {
$marshallOptions['forceTargetSave'] = $options['forceTargetSave'];
if (isset($options['forceTargetNew'])) {
$marshallOptions['forceTargetNew'] = $options['forceTargetNew'];
}

$errors = $this->_validate($data, $options, true);
Expand Down Expand Up @@ -294,7 +294,7 @@ public function many(array $data, array $options = [])
protected function _belongsToMany(Association $assoc, array $data, $options = [])
{
$associated = isset($options['associated']) ? $options['associated'] : [];
$forceTargetSave = isset($options['forceTargetSave']) ? $options['forceTargetSave'] : false;
$forceTargetNew = isset($options['forceTargetNew']) ? $options['forceTargetNew'] : false;

$data = array_values($data);

Expand All @@ -313,7 +313,7 @@ protected function _belongsToMany(Association $assoc, array $data, $options = []
foreach ($keys as $key => $value) {
$conditions[][$target->aliasfield($key)] = $value;
}
if ($forceTargetSave && !$target->exists($conditions)) {
if ($forceTargetNew && !$target->exists($conditions)) {
$records[$i] = $this->one($row, $options);
}
}
Expand Down

0 comments on commit a005fa6

Please sign in to comment.