From 223e3ac5407a4a6961214e832b5fc8cc9b6bc047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=ADa=20G=C3=B3mez?= Date: Wed, 7 Apr 2021 00:00:07 +0200 Subject: [PATCH] added name column to models --- fsmaker.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/fsmaker.php b/fsmaker.php index 98c5c3f..262947e 100644 --- a/fsmaker.php +++ b/fsmaker.php @@ -153,10 +153,13 @@ public function getModelClassName() { - + - + + + + @@ -229,6 +232,9 @@ protected function createViews() { protected function createViews'.$modelName.'(string $viewName = "List'.$modelName.'") { $this->addView($viewName, "'.$modelName.'", "'.$title.'"); + $this->addOrderBy($viewName, ["id"], "id"); + $this->addOrderBy($viewName, ["name"], "name", 1); + $this->addSearchFields($viewName, ["id", "name"]); } }'); $xmlviewFilename = $this->isCoreFolder() ? 'Core/XMLView/List'.$modelName.'.xml' : 'XMLView/List'.$modelName.'.xml'; @@ -243,7 +249,10 @@ protected function createViews'.$modelName.'(string $viewName = "List'.$modelNam - + + + + @@ -275,6 +284,7 @@ class '.$name.' extends \\FacturaScripts\\Core\\Model\\Base\\ModelClass public $creationdate; public $id; + public $name; public function clear() { $this->creationdate = \date(self::DATETIME_STYLE); @@ -297,6 +307,10 @@ public static function tableName() { id serial + + name + character varying(100) + creationdate timestamp