protected function getValidator() {
		$validator = $this->createValidator();
		$constrains = [];
		$messages = [];

		foreach($this->fields as $name=>$field) {
			if($field instanceof Field) {
				if($field_rules = $field->getValidationRules())
					$constrains[$name] = $field_rules;
				if($field_messages = $field->getValidationMessages())
					$messages[$name] = $field_messages;
			}
		}

		$validator->set('group', $this);
		$validator->attributes($constrains);
		$validator->attributesMessages($messages);
		return $validator;
	}