ZenMagick 0.9.6


org.zenmagick.validation.rules.ZMDateRule

Class ZMDateRule

ZMObject
|
+--ZMRule
|
+--ZMDateRule

public class ZMDateRule
extends ZMRule

Date validation rule.

Author:
DerManoMann
Version:
$Id: ZMDateRule.php 2158 2009-04-16 01:34:04Z dermanomann $

Constructor Summary

ZMDateRule(string name, string format, string msg)

Create new date rule.

Method Summary
string

getErrorMsg()

Return an appropriate error message.

protected void

getFormat()

Get the format string.

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

ZMDateRule

public ZMDateRule(string name, string format, string msg)

Create new date rule.

Parameters:
name - The field name.
format - The date format (eg: DD/MM/YYYY); if null, UI_DATE_FORMAT will be used.
msg - Optional message.

Method Detail

getErrorMsg

public string getErrorMsg()

Return an appropriate error message.

Returns:
Localized error message.

getFormat

protected void getFormat()

Get the format string. /


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