Implemented that chores can be assigned to users (closes #253)

This commit is contained in:
Bernd Bestel
2019-09-17 13:13:26 +02:00
parent 3dcd513094
commit 74f9470769
65 changed files with 987 additions and 75 deletions

View File

@@ -88,10 +88,20 @@ function SumArrayValue($array, $propertyName)
return $sum;
}
function GetClassConstants($className)
function GetClassConstants($className, $prefix = null)
{
$r = new ReflectionClass($className);
return $r->getConstants();
$constants = $r->getConstants();
if ($prefix === null)
{
return $constants;
}
else
{
$matchingKeys = preg_grep('!^' . $prefix . '!', array_keys($constants));
return array_intersect_key($constants, array_flip($matchingKeys));
}
}
function RandomString($length, $allowedChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')