abstract class CustomValidator

Abstract parent class for our child validation child classes. Each child class must implement the runValidation() function.

Properties

array $additionalFieldData

Additional field data.

string $field

Name of field being validated.

bool $includeDeleted

Include deleted default is false.

protected string $_model

Name of the model.

string $message

Message when validation fails.

mixed $rule

Rule for validation success.

bool $success

Flag to mark whether or not validation is successful.

Methods

__construct(object $model, array $params)

Constructor for Custom Validator. It performs checks on the model and params such as fields, rules, and messages. Finally the validation is performed against input from a form. An exception is thrown if any conditions are not satisfied. When an exception is thrown a message is displayed describing the issue.

void
runValidation()

Signature for the runValidation function that must be implemented by each child class.

Details

at line 68
__construct(object $model, array $params)

Constructor for Custom Validator. It performs checks on the model and params such as fields, rules, and messages. Finally the validation is performed against input from a form. An exception is thrown if any conditions are not satisfied. When an exception is thrown a message is displayed describing the issue.

Parameters

object $model

The name of the model we want to perform validation when submitting a form.

array $params

A list of values obtained from an input when a form is submitted during a post action.

at line 117
abstract void runValidation()

Signature for the runValidation function that must be implemented by each child class.

Return Value

void