core/model/modx/validation/modvalidator.class.php
- Package
- modx
- Subpackage
- validation
\modValidator
Package: modx\validation
Custom validation class for modx
Extend this class to customize the validation process.
- Parent(s)
- \xPDOValidator
Properties

$messages= 'array()'
inheritedInherited from:
\xPDOValidator::$$messages
Default value
array()Details- Type
- n/a
- Inherited_from
- \xPDOValidator::$$messages

$object= 'null'
inheritedInherited from:
\xPDOValidator::$$object
Default value
nullDetails- Type
- n/a
- Inherited_from
- \xPDOValidator::$$object

$results= 'array()'
inheritedInherited from:
\xPDOValidator::$$results
Default value
array()Details- Type
- n/a
- Inherited_from
- \xPDOValidator::$$results
Methods

__construct(
$object
)
:
void
inherited
Inherited from:
\xPDOValidator::__construct()
Parameters
| Name | Type | Description |
|---|---|---|
| $object |

addMessage(
string $field, string $name, mixed $message
=
null
)
:
void
Parameters
| Name | Type | Description |
|---|---|---|
| $field | string | The name of the field the message relates to. |
| $name | string | The name of the rule the message relates to. |
| $message | mixed | An optional message; the name of the rule is used if no message is specified. |

getMessages(
)
:
array
inherited
Get the validation messages generated by validate().
Inherited from: \xPDOValidator::getMessages()
Returns
| Type | Description |
|---|---|
| array | An array of validation messages. |

getResults(
)
:
array
inherited
Get the validation results generated by validate().
Inherited from: \xPDOValidator::getResults()
Returns
| Type | Description |
|---|---|
| array | An array of boolean validation results. |

hasMessages(
)
:
boolean
inherited
Indicates validation messages were generated by validate().
Inherited from: \xPDOValidator::hasMessages()
Returns
| Type | Description |
|---|---|
| boolean | True if messages were generated. |