/** * Validate a set of data according to a set of rules * * @return boolean */ public function validate() { $validators = $this->element->getValidators(); foreach ($validators as $v) { if (!$this->isValid()) { break; } $v->validate($this); } return $this->valid; }
/** * Validate a set of data according to a set of rules * * @return boolean * @throws Exception */ public function validate() { $validators = $this->element->getValidators(); foreach ($validators as $v) { if (false === $v->validate($this)) { $this->valid = false; } else { $this->valid = true; } } return $this->valid; }