Skip to content

Commit

Permalink
code standards
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Nov 20, 2011
1 parent 8e38f66 commit f0fa6c7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lib/Cake/Console/Command/Task/ModelTask.php
Expand Up @@ -550,7 +550,7 @@ public function findHasOneAndMany($model, $associations) {
$modelFieldsTemp = $tempOtherModel->schema(true);

$pattern = '/_' . preg_quote($model->table, '/') . '|' . preg_quote($model->table, '/') . '_/';
$possibleJoinTable = preg_match($pattern , $otherTable);
$possibleJoinTable = preg_match($pattern, $otherTable);
if ($possibleJoinTable == true) {
continue;
}
Expand Down Expand Up @@ -661,7 +661,8 @@ public function doMoreAssociations($model, $associations) {
$this->out(__d('cake_console', 'What is the association type?'));
$assocType = intval($this->inOptions($assocs, __d('cake_console', 'Enter a number')));

$this->out(__d('cake_console', "For the following options be very careful to match your setup exactly.\nAny spelling mistakes will cause errors."));
$this->out(__d('cake_console', "For the following options be very careful to match your setup exactly.\n" .
"Any spelling mistakes will cause errors."));
$this->hr();

$alias = $this->in(__d('cake_console', 'What is the alias for this association?'));
Expand Down Expand Up @@ -755,10 +756,15 @@ public function bake($name, $data = array()) {
'useTable' => null, 'useDbConfig' => 'default', 'displayField' => null);
$data = array_merge($defaults, $data);

$pluginPath = '';
if ($this->plugin) {
$pluginPath = $this->plugin . '.';
}

$this->Template->set($data);
$this->Template->set(array(
'plugin' => $this->plugin,
'pluginPath' => empty($this->plugin) ? '' : $this->plugin . '.'
'pluginPath' => $pluginPath
));
$out = $this->Template->generate('classes', 'model');

Expand Down Expand Up @@ -876,15 +882,17 @@ public function getName($useDbConfig = null) {
$enteredModel = '';

while ($enteredModel == '') {
$enteredModel = $this->in(__d('cake_console', "Enter a number from the list above,\ntype in the name of another model, or 'q' to exit"), null, 'q');
$enteredModel = $this->in(__d('cake_console', "Enter a number from the list above,\n" .
"type in the name of another model, or 'q' to exit"), null, 'q');

if ($enteredModel === 'q') {
$this->out(__d('cake_console', 'Exit'));
$this->_stop();
}

if ($enteredModel == '' || intval($enteredModel) > count($this->_modelNames)) {
$this->err(__d('cake_console', "The model name you supplied was empty,\nor the number you selected was not an option. Please try again."));
$this->err(__d('cake_console', "The model name you supplied was empty,\n" .
"or the number you selected was not an option. Please try again."));
$enteredModel = '';
}
}
Expand Down

0 comments on commit f0fa6c7

Please sign in to comment.