protected function _setValidators(Table $table) {
		$methods = get_class_methods($this);

		foreach ($methods as $method) {
			if (substr($method, 0, 10) === 'validation') {
				if ($this->config['passDefaultValidator']) {
					$validator = $table->getValidator('default');
				} else {
					$validator = new Validator();
				}

				$validator = $this->{$method}($validator);
				if (!$validator instanceof Validator) {
					throw new RuntimeException('Object must be of type ' . Validator::class . '. Method ' . $method . ' returned ' . get_class($validator));
				}

				$table->setValidator(lcfirst(substr($method, 10)), $validator);
			}
		}
	}
protected function _setValidators(Table $table) {
		$methods = get_class_methods($this);

		foreach ($methods as $method) {
			if (substr($method, 0, 10) === 'validation') {
				if ($this->config['passDefaultValidator']) {
					$validator = $table->getValidator('default');
				} else {
					$validator = new Validator();
				}

				$validator = $this->{$method}($validator);
				if (!$validator instanceof Validator) {
					throw new RuntimeException('Object must be of type ' . Validator::class . '. Method ' . $method . ' returned ' . get_class($validator));
				}

				$table->setValidator(lcfirst(substr($method, 10)), $validator);
			}
		}
	}
protected function _setValidators ( Table $ table ) { $ methods = get_class_methods ( $ this ) ; foreach ( $ methods as $ method ) { if ( substr ( $ method , 0 , 10 ) === 'validation' ) { if ( $ this -> config [ 'passDefaultValidator' ] ) { $ validator = $ table -> getValidator ( 'default' ) ; } else { $ validator = new Validator ( ) ; } $ validator = $ this -> { $ method } ( $ validator ) ; if ( ! $ validator instanceof Validator ) { throw new RuntimeException ( 'Object must be of type ' . Validator :: class . '. Method ' . $ method . ' returned ' . get_class ( $ validator ) ) ; } $ table -> setValidator ( lcfirst ( substr ( $ method , 10 ) ) , $ validator ) ; } } }
Sets the configured validators to the table instance

@param \Cake\ORM\Table $table
@return void
Sets the configured validators to the table instance