mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Implemented that chores can be assigned to users (closes #253)
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user