/** * Validates array against schema. * * * @return ValidatorResult */ public function validate() { $schema = $this->getSchema(); $validator = new Volan($schema); $validator->setParams(['client' => $this->getClient()]); return $validator->validate($this->toArray()); }
/** * Validates array against schema. * * Sets error if validation fails. * * @param array|object $arr * @param bool $requiredMode * * @return ValidatorResult */ public function validate($arr, $requiredMode = true) { $schema = $this->getSchema(); $validator = new Volan($schema); $validator->setRequiredMode($requiredMode); $validator->setParams(['client' => $this->getClient()]); return $validator->validate($arr); }