You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
720 B
34 lines
720 B
<?php
|
|
namespace FormGuide\PHPFormValidator;
|
|
|
|
class FieldValidatorCollection
|
|
{
|
|
public $fields;
|
|
private $validator;
|
|
|
|
|
|
public function __construct()
|
|
{
|
|
$this->fields = array();
|
|
$this->validator_map = include('ValidatorMap.php');
|
|
}
|
|
|
|
public function __call($function, $arguments)
|
|
{
|
|
if(isset($this->validator_map[$function]))
|
|
{
|
|
foreach($this->fields as $field)
|
|
{
|
|
$field->initValidator($function, $arguments);
|
|
}
|
|
return $this;
|
|
}
|
|
else
|
|
{
|
|
trigger_error('Call to undefined method '.__CLASS__.'::'.$name.'()', E_USER_ERROR);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} |