ZenMagick 0.9.6


org.zenmagick.validation.rules.custom.ZMGVAmountRule

Class ZMGVAmountRule

ZMObject
|
+--ZMRule
|
+--ZMGVAmountRule

public class ZMGVAmountRule
extends ZMRule

Validate the amount against the current account's gv balance.

NOTE: The amount is expected to be of type float and must not contains any currency formatting.

Author:
DerManoMann
Version:
$Id: ZMGVAmountRule.php 1966 2009-02-14 10:52:50Z dermanomann $

Constructor Summary

ZMGVAmountRule(string name, string msg)

Create new required rule.

Method Summary
string

toJSString()

Create JS validation call.

boolean

validate(array req)

Validate the given request data.

Methods inherited from org.zenmagick.validation.ZMRule
getDefaultMsg, getErrorMsg, getJSName, getMsg, getName, toJSString, validate
Methods inherited from org.zenmagick.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

ZMGVAmountRule

public ZMGVAmountRule(string name, string msg)

Create new required rule.

Parameters:
name - The field name.
msg - Optional message.

Method Detail

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

validate

public boolean validate(array req)

Validate the given request data.

Parameters:
req - The request data.
Returns:
true if the value for $name is valid, false if not.

ZenMagick 0.9.6