From 6fa22a9b0c5e494f622a086cc931bd47d8a10bbb Mon Sep 17 00:00:00 2001 From: Benn Oshrin Date: Sun, 1 Dec 2024 07:14:31 -0500 Subject: [PATCH] Additional commit for CFM-394 --- app/src/Lib/Traits/SearchFilterTrait.php | 4 +++- app/src/Lib/Util/StringUtilities.php | 17 +++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/src/Lib/Traits/SearchFilterTrait.php b/app/src/Lib/Traits/SearchFilterTrait.php index eeaec4665..d113155fd 100644 --- a/app/src/Lib/Traits/SearchFilterTrait.php +++ b/app/src/Lib/Traits/SearchFilterTrait.php @@ -231,10 +231,12 @@ public function getFilterConfig(): array { * Obtain the set of permitted search attributes. * * @since COmanage Registry v5.0.0 + * @param string $controller Controller name + * @param DateTimeZone $vv_tz Current time zone, if known * @return array Array of permitted search attributes and configuration elements needed for display */ - public function getSearchableAttributes(string $controller, string $vv_tz=null): array { + public function getSearchableAttributes(string $controller, \DateTimeZone $vv_tz=null): array { $modelname = Inflector::classify(Inflector::underscore($controller)); $filterConfig = $this->getFilterConfig(); diff --git a/app/src/Lib/Util/StringUtilities.php b/app/src/Lib/Util/StringUtilities.php index 758e97d56..fa948681d 100644 --- a/app/src/Lib/Util/StringUtilities.php +++ b/app/src/Lib/Util/StringUtilities.php @@ -49,14 +49,19 @@ public static function classNameToForeignKey(string $className): string { * Construct the Column human-readable key * * @since COmanage Registry v5.0.0 - * @param string $modelsName The name of the Model - * @param string $c The name of the column - * @param string $tz The timezone - * @param boolean $useCustomClMdlLabel Whether to use a custom `Model.column` field entry or rely on the default - * @return string Column friendly name + * @param string $modelsName The name of the Model + * @param string $c The name of the column + * @param DateTimeZone $tz The timezone + * @param boolean $useCustomClMdlLabel Whether to use a custom `Model.column` field entry or rely on the default + * @return string Column friendly name */ - public static function columnKey($modelsName, $c, $tz=null, $useCustomClMdlLabel=false): string { + public static function columnKey( + string $modelsName, + string $c, + \DateTimeZone $tz=null, + bool $useCustomClMdlLabel=false + ): string { if(strpos($c, "_id", strlen($c)-3)) { $postfix = ""; if($c == "parent_id") {