Browse Source

Make method name better represent what it is going to do.

Refs #5002
mark_story 11 years ago
parent
commit
daf73ef7c6

+ 1 - 1
src/Core/ConventionsTrait.php

@@ -80,7 +80,7 @@ trait ConventionsTrait {
  * @param string $name Name to use
  * @return string Plural name for views
  */
-	protected function _pluralName($name) {
+	protected function _variableName($name) {
 		return Inflector::variable($name);
 	}
 

+ 2 - 2
src/Shell/Task/ControllerTask.php

@@ -90,10 +90,10 @@ class ControllerTask extends BakeTask {
 
 		$modelObj = TableRegistry::get($currentModelName);
 
-		$pluralName = $this->_pluralName($currentModelName);
+		$pluralName = $this->_variableName($currentModelName);
 		$singularName = $this->_singularName($currentModelName);
 		$singularHumanName = $this->_singularHumanName($controllerName);
-		$pluralHumanName = $this->_pluralName($controllerName);
+		$pluralHumanName = $this->_variableName($controllerName);
 
 		$this->Template->set(compact(
 			'plugin', 'admin', 'pluralName', 'singularName',

+ 2 - 2
src/Template/Bake/default/actions/controller_actions.ctp

@@ -82,7 +82,7 @@ $allAssociations = array_merge(
 		foreach ($editAssociations as $assoc):
 			$association = $modelObj->association($assoc);
 			$otherName = $association->target()->alias();
-			$otherPlural = $this->_pluralName($otherName);
+			$otherPlural = $this->_variableName($otherName);
 			echo "\t\t\${$otherPlural} = \$this->{$currentModelName}->{$otherName}->find('list');\n";
 			$compact[] = "'{$otherPlural}'";
 		endforeach;
@@ -115,7 +115,7 @@ $allAssociations = array_merge(
 		foreach ($editAssociations as $assoc):
 			$association = $modelObj->association($assoc);
 			$otherName = $association->target()->alias();
-			$otherPlural = $this->_pluralName($otherName);
+			$otherPlural = $this->_variableName($otherName);
 			echo "\t\t\${$otherPlural} = \$this->{$currentModelName}->{$otherName}->find('list');\n";
 			$compact[] = "'{$otherPlural}'";
 		endforeach;