API Reflection , . , , . , , . , .
, , , Reflection. , . . .
__call ( ), class_implements, , , , Validator
public function __call($method, $args)
{
if ( class_exists( $method )) {
$validator = new $method;
if($validator instanceof IValidate) {
return call_user_func(array($validator, 'validate'), $args);
}
throw new BadMethodCallException('Class exists but is not a Validator');
}
throw new RuntimeException('Method does not exist');
}
: Zend Framework , . ZF , , ZF. PEAR .