Browse Source

Documenting a couple methods

Jose Lorenzo Rodriguez 12 years ago
parent
commit
c602589e9c

+ 15 - 0
src/Model/Behavior/TranslateBehavior.php

@@ -339,6 +339,14 @@ class TranslateBehavior extends Behavior {
 		});
 	}
 
+/**
+ * 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 @@ class TranslateBehavior extends Behavior {
 		$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()

+ 1 - 0
tests/TestCase/Model/Behavior/TranslateBehaviorTest.php

@@ -635,4 +635,5 @@ class TranslateBehaviorTest extends TestCase {
 		$this->assertEquals('Titulo', $translations['spa']->get('title'));
 		$this->assertEquals('Titre', $translations['fre']->get('title'));
 	}
+
 }