mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
updating bake view templates
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5266 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1737dba3d6
commit
95bb7e0f04
4 changed files with 10 additions and 1 deletions
|
@ -38,7 +38,7 @@
|
|||
}
|
||||
}
|
||||
foreach($hasAndBelongsToMany as $assocName => $assocData) {
|
||||
echo "\t\techo \$form->input('{$assocName}.{$assocName}');\n";
|
||||
echo "\t\techo \$form->input('{$assocName}');\n";
|
||||
}
|
||||
echo "\t?>\n";
|
||||
?>
|
||||
|
|
|
@ -51,6 +51,9 @@ foreach(\${$pluralVar} as \${$singularVar}):
|
|||
$otherModelKey = Inflector::underscore($otherModelClass);
|
||||
$otherControllerName = Inflector::pluralize($otherModelClass);
|
||||
$otherControllerPath = Inflector::underscore($otherControllerName);
|
||||
if(isset($foreignKeys[$field['name']][2])) {
|
||||
$otherModelClass = $foreignKeys[$field['name']][2];
|
||||
}
|
||||
$otherVariableName = Inflector::variable($otherModelClass);
|
||||
$otherModelObj =& ClassRegistry::getObject($otherModelKey);
|
||||
$otherPrimaryKey = $otherModelObj->primaryKey;
|
||||
|
|
|
@ -40,6 +40,9 @@ foreach($fields as $field) {
|
|||
$otherModelKey = Inflector::underscore($otherModelClass);
|
||||
$otherControllerName = Inflector::pluralize($otherModelClass);
|
||||
$otherControllerPath = Inflector::underscore($otherControllerName);
|
||||
if(isset($foreignKeys[$field['name']][2])) {
|
||||
$otherModelClass = $foreignKeys[$field['name']][2];
|
||||
}
|
||||
$otherSingularVar = Inflector::variable($otherModelClass);
|
||||
$otherModelObj =& ClassRegistry::getObject($otherModelKey);
|
||||
$otherPrimaryKey = $otherModelObj->primaryKey;
|
||||
|
|
|
@ -722,6 +722,9 @@ class Model extends Overloadable {
|
|||
if ($key == 'foreignKey' && !isset($this->keyToTable[$this->{$type}[$assocKey][$key]])) {
|
||||
$this->keyToTable[$this->{$type}[$assocKey][$key]][0] = $this->{$class}->table;
|
||||
$this->keyToTable[$this->{$type}[$assocKey][$key]][1] = $this->{$class}->name;
|
||||
if($this->{$class}->name != $class) {
|
||||
$this->keyToTable[$this->{$type}[$assocKey][$key]][2] = $class;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($this->{$type}[$assocKey]['with'])) {
|
||||
|
|
Loading…
Reference in a new issue