modelGenerator: create automatillay foreign objects if needed
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3812 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -158,6 +158,20 @@ class modelGenerator
|
|||||||
implode ("\", \"", $params).
|
implode ("\", \"", $params).
|
||||||
"\"),\n";
|
"\"),\n";
|
||||||
$f .= " ));\n";
|
$f .= " ));\n";
|
||||||
|
|
||||||
|
$f .= "\n";
|
||||||
|
$f .= " // And the associated objects\n";
|
||||||
|
if ($this->namespaceName === false)
|
||||||
|
$path = "\\models\\";
|
||||||
|
elseif ($this->namespaceName !== "")
|
||||||
|
$path = "\\$this->namespaceName\\";
|
||||||
|
else
|
||||||
|
$path = "";
|
||||||
|
foreach ($schema["foreign"] as $field=>$params)
|
||||||
|
{
|
||||||
|
$f .= " \$this->foreign_$field = new $path$field ();\n";
|
||||||
|
$f .= " \$this->setForeignObj (\$this->foreign_$field);\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$f .= " }\n";
|
$f .= " }\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user