Skip to content
Permalink
Browse files

Documenting a couple methods

  • Loading branch information...
lorenzo committed Feb 15, 2014
1 parent 0dced17 commit c602589e9cfd3088d1b951c19d227af76a502bd3
@@ -339,6 +339,14 @@ protected function _groupTranslations($results) {
});
}
/**
* Helper method used to generated multiple translated field entities
* out fo the data found in the `_translations` property in the passed
* entity. The result will be put into its `_i18n` property
*
* @param \Cake\ORM\Entity $entity
* @return void
*/
protected function _bundleTranslatedFields($entity) {
$translations = (array)$entity->get('_translations');
@@ -384,6 +392,13 @@ protected function _bundleTranslatedFields($entity) {
$entity->set('_i18n', $contents);
}
/**
* Returns the ids found for each of the condition arrays passed for the translations
* table. Each records is index by the corresponding position to the conditions array
*
* @param array $ruleSet an array of arary of conditions to be used for finding each
* @return array
*/
protected function _findExistingTranslations($ruleSet) {
$association = $this->_table->association($this->config()['translationTable']);
$query = $association->find()
@@ -635,4 +635,5 @@ public function testSaveMultipleNewTranslations() {
$this->assertEquals('Titulo', $translations['spa']->get('title'));
$this->assertEquals('Titre', $translations['fre']->get('title'));
}
}

0 comments on commit c602589

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