modelGenerator: use the titles and foreign methods instead of using the properties

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3776 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2017-06-15 07:06:16 +00:00
parent 8e97e5eb54
commit fd2d6252ff

View File

@@ -142,22 +142,22 @@ class modelGenerator
} }
$f .= "\n"; $f .= "\n";
$f .= " // The titles\n"; $f .= " // The titles\n";
$f .= " \$this->titles = array (\n"; $f .= " \$this->titles (array (\n";
foreach ($schema["fields"] as $field=>$params) foreach ($schema["fields"] as $field=>$params)
{ {
$f .= " \"$field\" => _(\"$field\"),\n"; $f .= " \"$field\" => _(\"$field\"),\n";
} }
$f .= " );\n"; $f .= " ));\n";
if (count ($schema["foreign"])) if (count ($schema["foreign"]))
{ {
$f .= "\n"; $f .= "\n";
$f .= " // The foreign constraints\n"; $f .= " // The foreign constraints\n";
$f .= " \$this->foreign = array (\n"; $f .= " \$this->foreign (array (\n";
foreach ($schema["foreign"] as $field=>$params) foreach ($schema["foreign"] as $field=>$params)
$f .= " \"$field\" => array (\n \"". $f .= " \"$field\" => array (\n \"".
implode ("\", \"", $params). implode ("\", \"", $params).
"\"),\n"; "\"),\n";
$f .= " );\n"; $f .= " ));\n";
} }
$f .= " }\n"; $f .= " }\n";