diff --git a/application/core/Utils/Formatter.php b/application/core/Utils/Formatter.php index 2e28143e..313ae7b9 100644 --- a/application/core/Utils/Formatter.php +++ b/application/core/Utils/Formatter.php @@ -176,4 +176,18 @@ abstract class Formatter { } return 'OTH'; } + + /** + * Parse the given Value into a Bool + * + * @param mixed $value + * @return bool + */ + public static function parseBoolean($value) { + if (is_string($value)) { + $value = strtolower($value); + } + $bool = filter_var($value, FILTER_VALIDATE_BOOLEAN); + return $bool; + } }