protected function castValue($cast, $value)
    {
        switch ($cast) {
            case 'integer';
                $value = (integer) $value;
                break;
            case 'boolean';
                $value = in_array($value, array('true', 't', 'yes', 'y'));
                break;
            case 'string':
            default:
                $value = (string) $value;
        }

        return $value;
    }
protected function castValue($cast, $value)
    {
        switch ($cast) {
            case 'integer';
                $value = (integer) $value;
                break;
            case 'boolean';
                $value = in_array($value, array('true', 't', 'yes', 'y'));
                break;
            case 'string':
            default:
                $value = (string) $value;
        }

        return $value;
    }
protected function castValue ( $ cast , $ value ) { switch ( $ cast ) { case 'integer' ; $ value = ( integer ) $ value ; break ; case 'boolean' ; $ value = in_array ( $ value , array ( 'true' , 't' , 'yes' , 'y' ) ) ; break ; case 'string' : default : $ value = ( string ) $ value ; } return $ value ; }
Helper function to cast values

@param $cast
@param $value

@return bool|int|string
Helper function to cast values