original_string: protected function validateUserIdAddress()
      {
          $field = 'user_id';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
  
          if ($this->isUpdating() && !isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          $label = $this->translation->text('User');
  
          if (empty($value) || mb_strlen($value) > 255) {
              $this->setErrorLengthRange($field, $label);
              return false;
          }
  
          if (!is_numeric($value)) {
              return true; // Anonymous user
          }
  
          $user = $this->user->get($value);
  
          if (empty($user)) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          return true;
      }
code: protected function validateUserIdAddress()
      {
          $field = 'user_id';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
  
          if ($this->isUpdating() && !isset($value)) {
              $this->unsetSubmitted($field);
              return null;
          }
  
          $label = $this->translation->text('User');
  
          if (empty($value) || mb_strlen($value) > 255) {
              $this->setErrorLengthRange($field, $label);
              return false;
          }
  
          if (!is_numeric($value)) {
              return true; // Anonymous user
          }
  
          $user = $this->user->get($value);
  
          if (empty($user)) {
              $this->setErrorUnavailable($field, $label);
              return false;
          }
  
          return true;
      }
code_tokens: protected function validateUserIdAddress ( ) { $ field = 'user_id' ; if ( $ this -> isExcluded ( $ field ) ) { return null ; } $ value = $ this -> getSubmitted ( $ field ) ; if ( $ this -> isUpdating ( ) && ! isset ( $ value ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } $ label = $ this -> translation -> text ( 'User' ) ; if ( empty ( $ value ) || mb_strlen ( $ value ) > 255 ) { $ this -> setErrorLengthRange ( $ field , $ label ) ; return false ; } if ( ! is_numeric ( $ value ) ) { return true ; // Anonymous user } $ user = $ this -> user -> get ( $ value ) ; if ( empty ( $ user ) ) { $ this -> setErrorUnavailable ( $ field , $ label ) ; return false ; } return true ; }
docstring: Validates a user Id
  @return boolean
docstring_tokens: Validates a user Id