From c4489dd2ad70580257783f8de93f41da71039ac8 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 19 May 2017 08:09:07 +0000 Subject: [PATCH] modelGenerator: manage correctely the CR in missing sections git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3704 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- tools/modelGenerator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/modelGenerator.php b/tools/modelGenerator.php index 6f38168..30d8c9e 100755 --- a/tools/modelGenerator.php +++ b/tools/modelGenerator.php @@ -110,9 +110,10 @@ class modelGenerator } $f .= " ));\n\n"; $f .= " // The primary key\n"; - $f .= " \$this->primary (\"".$schema["primary"]."\");\n\n"; + $f .= " \$this->primary (\"".$schema["primary"]."\");\n"; if (count ($schema["unique"])) { + $f .= "\n"; $f .= " // The unique constraints\n"; $f .= " \$this->unique (array (\n"; foreach ($schema["unique"] as $unique) @@ -130,9 +131,10 @@ class modelGenerator { $f .= " \"$field\" => _(\"$field\"),\n"; } - $f .= " );\n\n"; + $f .= " );\n"; if (count ($schema["foreign"])) { + $f .= "\n"; $f .= " // The foreign constraints\n"; $f .= " \$this->foreign = array (\n"; foreach ($schema["foreign"] as $field=>$params)