ZenMagick 0.9.10


zenmagick.store.shared.mvc.validation\ZMDateRule
mvc\validation\ZMDateRule.php at line 30

Class ZMDateRule

ZMObject
└─ZMRule
└─ZMDateRule

public class ZMDateRule
extends ZMRule

Date validation rule.

Author:
DerManoMann

Method Summary
void

__construct(string name, string format, string msg, string defaultMsg)

Create new date rule.

string

getErrorMsg()

Return an appropriate error message.

protected void

getFormat()

Get the format string.

string

toJSString()

Create JS validation call.

boolean

validate(ZMRequest request, array data)

Validate the given request data.

Methods inherited from org.zenmagick.mvc.validation\ZMRule
__construct, getDefaultMsg, getErrorMsg, getJSName, getMsg, getName, setDefaultMsg, setMsg, setName, toJSString, validate
Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

mvc\validation\ZMDateRule.php at line 41

__construct

public void __construct(string name, string format, string msg, string defaultMsg)

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.

mvc\validation\ZMDateRule.php at line 85

getErrorMsg

public string getErrorMsg()

Return an appropriate error message.

Returns:
Localized error message.

mvc\validation\ZMDateRule.php at line 57

getFormat

protected void getFormat()

Get the format string.


mvc\validation\ZMDateRule.php at line 95

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

mvc\validation\ZMDateRule.php at line 72

validate

public boolean validate(ZMRequest request, array data)

Validate the given request data.

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

ZenMagick 0.9.10