public function validateContent() { $errors = array(); if (!parent::validate_string_not_empty($this->content)) { $errors[] = 'Message must not be empty'; } if (!parent::validate_string_max($this->content, 2000)) { $errors[] = 'Message must not be longer than 2000 characters'; } return $errors; }
public function validateName() { $errors = array(); if (!parent::validate_string_not_empty($this->name)) { $errors[] = 'Name must not be empty'; } if (!parent::validate_string_min($this->name, 3)) { $errors[] = 'Name must be at least 3 characters'; } if (!parent::validate_string_max($this->name, 100)) { $errors[] = 'Name must be at no longer than 100 characters'; } return $errors; }
public function validatePassword() { $errors = array(); if (!parent::validate_string_not_empty($this->password)) { $errors[] = 'Password must not be empty'; } if (!parent::validate_string_max($this->password, 20)) { $errors[] = 'Password must not be longer than 20 characters'; } return $errors; }