From ae59ffaa97094854bcd1d863c6648a5b4dada671 Mon Sep 17 00:00:00 2001 From: igor Date: Sun, 15 Jun 2025 19:07:42 +0200 Subject: [PATCH] added getListOrganize for created new model --- src/Creator.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Creator.php b/src/Creator.php index dfa249b..5d53247 100644 --- a/src/Creator.php +++ b/src/Creator.php @@ -151,15 +151,19 @@ class ".$name." extends \TPsoft\DBmodel\DBmodel { ->toArray(); } - public function getListByID($"."search = array(), $"."reverse = false, $"."concat_or = false) { + public function getListOrganize($"."cola_name, $"."search = array(), $"."reverse = false, $"."concat_or = false) { $"."all = $"."this->getList($"."search, $"."reverse, $"."concat_or); $"."ret = array(); if (is_array($"."all)) foreach ($"."all as $"."key => $"."row) { - $"."ret[$"."row[$primary_key_name]] = $"."row; + $"."ret[$"."row[$"."cola_name]] = $"."row; } return $"."ret; } + public function getListByID($"."search = array(), $"."reverse = false, $"."concat_or = false) { + return $"."this->getListOrganize($primary_key_name, $"."search, $"."reverse, $"."concat_or); + } + public function ".$entity_one."Combo($"."col_key, $"."col_value, $"."add_empty = false) { return $"."this->search('".$entity."') ->toCombo($"."col_key, $"."col_value, $"."add_empty);