public static function setError($prefix = null, $field, $error) {

		if(null !== $prefix && false === is_string($prefix)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($prefix)), E_USER_ERROR);
		}

		if(false === is_string($field)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($field)), E_USER_ERROR);
		}

		if(false === is_string($error)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($error)), E_USER_ERROR);
		}

		if(false === isset(static :: $errors['short'][$field])) {
			static :: $errors['short'][$field] = $error;
		}

		if(false === isset(static :: $errors['full'][$field])) {

			if(null !== $prefix) {
				static :: $errors['full'][$prefix . '[' . $field . ']'] = $error;
			}
			else {
				static :: $errors['full'][$field] = $error;
			}
		}

		return static :: Instance();
	}
public static function setError($prefix = null, $field, $error) {

		if(null !== $prefix && false === is_string($prefix)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($prefix)), E_USER_ERROR);
		}

		if(false === is_string($field)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($field)), E_USER_ERROR);
		}

		if(false === is_string($error)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($error)), E_USER_ERROR);
		}

		if(false === isset(static :: $errors['short'][$field])) {
			static :: $errors['short'][$field] = $error;
		}

		if(false === isset(static :: $errors['full'][$field])) {

			if(null !== $prefix) {
				static :: $errors['full'][$prefix . '[' . $field . ']'] = $error;
			}
			else {
				static :: $errors['full'][$field] = $error;
			}
		}

		return static :: Instance();
	}
public static function setError ( $ prefix = null , $ field , $ error ) { if ( null !== $ prefix && false === is_string ( $ prefix ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ prefix ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ field ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ field ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ error ) ) { return trigger_error ( sprintf ( 'Argument 3 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ error ) ) , E_USER_ERROR ) ; } if ( false === isset ( static :: $ errors [ 'short' ] [ $ field ] ) ) { static :: $ errors [ 'short' ] [ $ field ] = $ error ; } if ( false === isset ( static :: $ errors [ 'full' ] [ $ field ] ) ) { if ( null !== $ prefix ) { static :: $ errors [ 'full' ] [ $ prefix . '[' . $ field . ']' ] = $ error ; } else { static :: $ errors [ 'full' ] [ $ field ] = $ error ; } } return static :: Instance ( ) ; }
Sets an error for the current field
@param string $prefix
@param string $field
@param string $error
@return sFire\Validator\Message
Sets an error for the current field