original_string: protected function validateRoleUser()
      {
          $field = 'role_id';
          $value = $this->getSubmitted($field);
  
          if (empty($value)) {
              return null;
          }
  
          $label = $this->translation->text('Role');
  
          if (!is_numeric($value)) {
              $this->setErrorNumeric($field, $label);
              return false;
          }
  
          $role = $this->role->get($value);
  
          if (empty($role)) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          return true;
      }
code: protected function validateRoleUser()
      {
          $field = 'role_id';
          $value = $this->getSubmitted($field);
  
          if (empty($value)) {
              return null;
          }
  
          $label = $this->translation->text('Role');
  
          if (!is_numeric($value)) {
              $this->setErrorNumeric($field, $label);
              return false;
          }
  
          $role = $this->role->get($value);
  
          if (empty($role)) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          return true;
      }
code_tokens: protected function validateRoleUser ( ) { $ field = 'role_id' ; $ value = $ this -> getSubmitted ( $ field ) ; if ( empty ( $ value ) ) { return null ; } $ label = $ this -> translation -> text ( 'Role' ) ; if ( ! is_numeric ( $ value ) ) { $ this -> setErrorNumeric ( $ field , $ label ) ; return false ; } $ role = $ this -> role -> get ( $ value ) ; if ( empty ( $ role ) ) { $ this -> setErrorUnavailable ( $ field , $ label ) ; return false ; } return true ; }
docstring: Validates a user role
  @return boolean|null
docstring_tokens: Validates a user role