mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Making bake model.ctp only include the association comment when there is a non empty association. Fixes #393
This commit is contained in:
parent
48cd4d5738
commit
9632e74cfc
1 changed files with 6 additions and 0 deletions
|
@ -56,9 +56,15 @@ if (!empty($validate)):
|
||||||
echo "\t);\n";
|
echo "\t);\n";
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
foreach ($associations as $assoc):
|
||||||
|
if (!empty($assoc)):
|
||||||
?>
|
?>
|
||||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||||
<?php
|
<?php
|
||||||
|
break;
|
||||||
|
endif;
|
||||||
|
endforeach;
|
||||||
|
|
||||||
foreach (array('hasOne', 'belongsTo') as $assocType):
|
foreach (array('hasOne', 'belongsTo') as $assocType):
|
||||||
if (!empty($associations[$assocType])):
|
if (!empty($associations[$assocType])):
|
||||||
$typeCount = count($associations[$assocType]);
|
$typeCount = count($associations[$assocType]);
|
||||||
|
|
Loading…
Reference in a new issue