Adding ArraUtil class
This commit is contained in:
16
workflow/engine/src/ProcessMaker/Util/ArrayUtil.php
Normal file
16
workflow/engine/src/ProcessMaker/Util/ArrayUtil.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
namespace ProcessMaker\Util;
|
||||||
|
|
||||||
|
class ArrayUtil
|
||||||
|
{
|
||||||
|
public static function boolToIntValues($array)
|
||||||
|
{
|
||||||
|
array_walk($array, function (&$v) {
|
||||||
|
if ($v === false) $v = 0;
|
||||||
|
elseif ($v === true) $v = 1;
|
||||||
|
elseif ($v === null) $v = 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
return $array;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user