UserModel::fixGender PHP Method

fixGender() public static method

Force gender to be a verified value.
public static fixGender ( string $Value ) : string
$Value string The gender string.
return string
    public static function fixGender($Value)
    {
        if (!$Value || !is_string($Value)) {
            return 'u';
        }
        if ($Value) {
            $Value = strtolower(substr(trim($Value), 0, 1));
        }
        if (!in_array($Value, ['u', 'm', 'f'])) {
            $Value = 'u';
        }
        return $Value;
    }
UserModel