public function validate() { $this->_name = $this->name->orThrow(ValidatorException::class, "Enter playlist name")->filter(Filter::lengthInRange(1, VALIDATOR_PLAYLIST_NAME_MAX_LENGTH))->getOrThrow(ValidatorException::class, sprintf("Playlist name must be in range from 1 to %d chars", VALIDATOR_PLAYLIST_NAME_MAX_LENGTH)); }
protected function validate() { $this->_email = $this->email->orThrow(ValidatorException::class, "You must specify your email")->filter(Filter::matchRegExp(VALIDATOR_EMAIL_TEMPLATE))->getOrThrow(ValidatorException::class, "You must specify correct email"); $this->_password = $this->password->orThrow(ValidatorException::class, "You must specify your password")->filter(Filter::lengthInRange(VALIDATOR_PWD_MIN_LENGTH, VALIDATOR_PWD_MAX_LENGTH))->getOrThrow(ValidatorException::class, sprintf("Password must be in range from %d to %d chars", VALIDATOR_PWD_MIN_LENGTH, VALIDATOR_PWD_MAX_LENGTH)); }