class Rule extends XMLElement
Data about a validation rule used in an application.
Methods
loadFromXML(array $attributes)
This is the entry point method for loading data from XML. |
from XMLElement | |
array |
getAttributes()
Returns the assoc array of attributes. |
from XMLElement |
mixed |
getAttribute(string $name, mixed $defaultValue = null)
Gets a particular attribute by [case-insensitive] name. |
from XMLElement |
appendXml(DOMNode $node) | ||
VendorInfo |
addVendorInfo(mixed $data)
Sets an associated VendorInfo object. |
from XMLElement |
VendorInfo |
getVendorInfoForType($type)
Gets the any associated VendorInfo object. |
from XMLElement |
string |
getConfiguredBehavior(string $bname)
Find the best class name for a given behavior Looks in build.properties for path like propel.behavior.[bname].class If not found, tries to autoload [Bname]Behavior If no success, returns 'Behavior' |
from XMLElement |
toString()
String representation of the current object. |
from XMLElement | |
__toString()
Magic string method |
from XMLElement | |
setValidator(Validator $validator)
Sets the owning validator for this rule. |
||
Validator |
getValidator()
Gets the owning validator for this rule. |
|
setClass(string $classname)
Sets the dot-path name of class to use for rule. |
||
string |
getClass()
Gets the dot-path name of class to use for rule. |
|
setName(string $name)
Sets the name of the validator for this rule. |
||
string |
getName()
Gets the name of the validator for this rule. |
|
setValue(string $value)
Sets the value parameter for this validator rule. |
||
string |
getValue()
Gets the value parameter for this validator rule. |
|
setMessage(string $message)
Sets the message that will be displayed to the user if validation fails. |
||
string |
getMessage()
Gets the message that will be displayed to the user if validation fails. |
Details
in XMLElement at line 47
public
loadFromXML(array $attributes)
This is the entry point method for loading data from XML.
It calls a setupObject() method that must be implemented by the child class.
in XMLElement at line 58
public array
getAttributes()
Returns the assoc array of attributes.
All attribute names (keys) are lowercase.
in XMLElement at line 70
public mixed
getAttribute(string $name, mixed $defaultValue = null)
Gets a particular attribute by [case-insensitive] name.
If attribute is not set then the $defaultValue is returned.
at line 178
public
appendXml(DOMNode $node)
in XMLElement at line 127
public VendorInfo
addVendorInfo(mixed $data)
Sets an associated VendorInfo object.
in XMLElement at line 146
public VendorInfo
getVendorInfoForType($type)
Gets the any associated VendorInfo object.
in XMLElement at line 166
public string
getConfiguredBehavior(string $bname)
Find the best class name for a given behavior Looks in build.properties for path like propel.behavior.[bname].class If not found, tries to autoload [Bname]Behavior If no success, returns 'Behavior'
in XMLElement at line 189
public
toString()
String representation of the current object.
This is an xml representation with the XML declaration removed.
in XMLElement at line 203
public
__toString()
Magic string method
at line 67
public
setValidator(Validator $validator)
Sets the owning validator for this rule.
at line 76
public Validator
getValidator()
Gets the owning validator for this rule.
at line 87
public
setClass(string $classname)
Sets the dot-path name of class to use for rule.
If no class is specified in XML, then a classname will
be built based on the 'name' attrib.
at line 98
public string
getClass()
Gets the dot-path name of class to use for rule.
If no class was specified, this method will build a default classname
based on the 'name' attribute. E.g. 'maxLength' -> 'propel.validator.MaxLengthValidator'
at line 113
public
setName(string $name)
Sets the name of the validator for this rule.
This name is used to build the classname if none was specified.
at line 122
public string
getName()
Gets the name of the validator for this rule.
at line 133
public
setValue(string $value)
Sets the value parameter for this validator rule.
Note: not all validators need a value parameter (e.g. 'required' validator
does not).
at line 142
public string
getValue()
Gets the value parameter for this validator rule.
at line 155
public
setMessage(string $message)
Sets the message that will be displayed to the user if validation fails.
This message may be a Gettext msgid (if translation="gettext") or some other
id for an alternative not-yet-supported translation system. It may also
be a simple, single-language string.
at line 168
public string
getMessage()
Gets the message that will be displayed to the user if validation fails.
This message may be a Gettext msgid (if translation="gettext") or some other
id for an alternative not-yet-supported translation system. It may also
be a simple, single-language string.