mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
bake fix for self joins
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4030 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
8657757bde
commit
7e5c99a426
1 changed files with 3 additions and 3 deletions
|
@ -980,7 +980,7 @@ class Bake {
|
|||
$viewView .= "\t<li><?php echo \$html->link('New " . $singularHumanName . "', '{$admin_url}/{$controllerPath}/add') ?> </li>\n";
|
||||
foreach( $fieldNames as $field => $value ) {
|
||||
if( isset( $value['foreignKey'] ) ) {
|
||||
$otherModelName = $this->__modelName($value['model']);
|
||||
$otherModelName = $this->__modelName($value['modelKey']);
|
||||
if($otherModelName != $currentModelName) {
|
||||
$otherControllerName = $this->__controllerName($otherModelName);
|
||||
$otherControllerPath = $this->__controllerPath($otherControllerName);
|
||||
|
@ -1076,7 +1076,7 @@ class Bake {
|
|||
$editView .= "<li><?php echo \$html->link('Delete','{$admin_url}/{$controllerPath}/delete/' . \$html->tagValue('{$modelObj->name}/{$modelObj->primaryKey}'), null, 'Are you sure you want to delete: id ' . \$html->tagValue('{$modelObj->name}/{$modelObj->primaryKey}'));?>\n";
|
||||
$editView .= "<li><?php echo \$html->link('List {$pluralHumanName}', '{$admin_url}/{$controllerPath}/index')?></li>\n";
|
||||
foreach ($modelObj->belongsTo as $associationName => $relation) {
|
||||
$otherModelName = $this->__modelName($associationName);
|
||||
$otherModelName = $this->__modelName($relation['className']);
|
||||
if($otherModelName != $currentModelName) {
|
||||
$otherControllerName = $this->__controllerName($otherModelName);
|
||||
$otherControllerPath = $this->__controllerPath($otherControllerName);
|
||||
|
@ -1098,7 +1098,7 @@ class Bake {
|
|||
$addView .= "<ul class=\"actions\">\n";
|
||||
$addView .= "<li><?php echo \$html->link('List {$pluralHumanName}', '{$admin_url}/{$controllerPath}/index')?></li>\n";
|
||||
foreach ($modelObj->belongsTo as $associationName => $relation) {
|
||||
$otherModelName = $this->__modelName($associationName);
|
||||
$otherModelName = $this->__modelName($relation['className']);
|
||||
if($otherModelName != $currentModelName) {
|
||||
$otherControllerName = $this->__controllerName($otherModelName);
|
||||
$otherControllerPath = $this->__controllerPath($otherControllerName);
|
||||
|
|
Loading…
Reference in a new issue