Skip to content

Commit

Permalink
Fixed some typos, CS errors and refactoring repetitive code
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 27, 2014
1 parent fd6a5db commit 8db0595
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/Model/Behavior/TranslateBehavior.php
Expand Up @@ -164,7 +164,7 @@ public function locale($locale = null) {
}

/**
* Custom finder method used to retrieve all translations for he found records.
* Custom finder method used to retrieve all translations for the found records.
* Fetched translations can be filtered by locale by passing the `locales` key
* in the options array.
*
Expand Down Expand Up @@ -219,13 +219,11 @@ protected function _rowMapper($results, $locale) {
continue;
}

$row->set([
$field => $translation->get('content'),
'_locale' => $locale
], $options);
$row->set($field, $translation->get('content'), $options);
unset($row[$name]);
}

$row->set('_locale', $locale, $options);
$row->clean();
return $row;
});
Expand Down
6 changes: 6 additions & 0 deletions src/ORM/Query.php
Expand Up @@ -35,16 +35,22 @@ class Query extends DatabaseQuery {

/**
* Indicates that the operation should append to the list
*
* @var integer
*/
const APPEND = 0;

/**
* Indicates that the operation should prepend to the list
*
* @var integer
*/
const PREPEND = 1;

/**
* Indicates that the operation should overwrite the list
*
* @var boolean
*/
const OVERWRITE = true;

Expand Down
1 change: 0 additions & 1 deletion tests/TestCase/Model/Behavior/TranslateBehaviorTest.php
Expand Up @@ -43,7 +43,6 @@ public function tearDown() {
TableRegistry::clear();
}


/**
* Returns an array with all the translations found for a set of records
*
Expand Down

0 comments on commit 8db0595

Please sign in to comment.