/** * Model validator * @return bool */ public function validate() { $this->propertyErrors = []; Validator::required($this, 'name', ['create']); Validator::required($this, 'email', ['create', 'login']); Validator::required($this, 'password', ['create', 'login']); Validator::isUnique($this, 'email', ['create']); Validator::strMaxLength($this, 'name', 30, ['create']); Validator::strMaxLength($this, 'surname', 45, ['create']); Validator::strMaxLength($this, 'email', 255, ['create']); return empty($this->propertyErrors); }
/** * Model validator * @return bool */ public function validate($clearErrors = true) { if ($clearErrors) { $this->propertyErrors = []; } Validator::required($this, 'uid', ['create']); Validator::required($this, 'path', ['create']); Validator::required($this, 'date', ['create']); Validator::required($this, 'description', ['create']); Validator::strMaxLength($this, 'path', 512, ['create']); Validator::strMaxLength($this, 'description', 255, ['create']); return empty($this->propertyErrors); }