ZenMagick 0.9.8


org.zenmagick.store.mvc.validation.ZMMaxFieldLengthRule
\store\mvc\validation\ZMMaxFieldLengthRule.php at line 31

Class ZMMaxFieldLengthRule

ZMObject
└─ZMRule
└─ZMMaxFieldLengthRule

public class ZMMaxFieldLengthRule
extends ZMRule

Max field length validation rule based on the database column length.

Author:
DerManoMann
Version:
$Id: ZMMaxFieldLengthRule.php 2694 2009-12-03 22:32:18Z dermanomann $

Constructor Summary

ZMMaxFieldLengthRule(string name, string table, string column, string msg)

Create new min length rule.

Method Summary
string

getErrorMsg()

Return an appropriate error message.

protected int

getMaxFieldLength()

Get the field length.

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
getDefaultMsg, getErrorMsg, getJSName, getMsg, getName, setDefaultMsg, setMsg, setName, toJSString, validate
Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

\store\mvc\validation\ZMMaxFieldLengthRule.php at line 45

ZMMaxFieldLengthRule

public ZMMaxFieldLengthRule(string name, string table, string column, string msg)

Create new min length rule.

Parameters:
name - The field name.
table - The database table.
column - The table column.
msg - Optional message.

Method Detail

\store\mvc\validation\ZMMaxFieldLengthRule.php at line 89

getErrorMsg

public string getErrorMsg()

Return an appropriate error message.

Returns:
Localized error message.

\store\mvc\validation\ZMMaxFieldLengthRule.php at line 76

getMaxFieldLength

protected int getMaxFieldLength()

Get the field length.

Returns:
The max field length.

\store\mvc\validation\ZMMaxFieldLengthRule.php at line 99

toJSString

public string toJSString()

Create JS validation call.

Returns:
Formatted JavaScript .

\store\mvc\validation\ZMMaxFieldLengthRule.php at line 67

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.8