From 2b183d15ad3de0faf7116f5c7491517311ecd2d2 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 19 Jul 2017 06:41:05 +0000 Subject: [PATCH] modelGenerator: Add the foreign keys objects in the constructor git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3814 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- tools/modelGenerator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/modelGenerator.php b/tools/modelGenerator.php index 473ff69..067eb18 100755 --- a/tools/modelGenerator.php +++ b/tools/modelGenerator.php @@ -169,8 +169,9 @@ class modelGenerator $path = ""; foreach ($schema["foreign"] as $field=>$params) { - $f .= " \$this->foreign_$field = new $path$field ();\n"; - $f .= " \$this->setForeignObj (\$this->foreign_$field);\n"; + $objName = $params[0]; + $f .= " \$this->foreign_$objName = new $path$objName ();\n"; + $f .= " \$this->setForeignObj (\$this->foreign_$objName);\n"; } }