add property and property definition

This commit is contained in:
Roland Schneider
2021-10-11 22:32:43 +02:00
parent a2c828cc19
commit e6d4d0ffc4
13 changed files with 604 additions and 1 deletions

View File

@@ -7,6 +7,14 @@ class AppArrayHelper
{
public static function mapValues($array, $func){
$result = [];
foreach ($array as $item){
$result[] = $func($item);
}
return $result;
}
public static function objectArrayToMap($array, $funcGetId, $funcGetValue){
$result = [];
@@ -37,4 +45,11 @@ class AppArrayHelper
);
}
public static function getOrDefault($array, $key, $defaultValue = null){
if ( isset($array[$key])){
return $array[$key];
}
return $defaultValue;
}
}