/** * 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); }