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
This commit is contained in:
2017-07-19 06:41:05 +00:00
parent bf31012a81
commit 2b183d15ad

View File

@@ -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";
}
}