boolean parse method
This commit is contained in:
		| @@ -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; | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user