original_string: protected function validate_userid($value) {
          global $DB;
  
          // During create.
          if (!$this->get('id')) {
  
              // Check that the user exists. We do not need to do that on update because
              // the userid of a plan should never change.
              if (!$DB->record_exists('user', array('id' => $value))) {
                  return new lang_string('invaliddata', 'error');
              }
  
          }
  
          return true;
      }
code: protected function validate_userid($value) {
          global $DB;
  
          // During create.
          if (!$this->get('id')) {
  
              // Check that the user exists. We do not need to do that on update because
              // the userid of a plan should never change.
              if (!$DB->record_exists('user', array('id' => $value))) {
                  return new lang_string('invaliddata', 'error');
              }
  
          }
  
          return true;
      }
code_tokens: protected function validate_userid ( $ value ) { global $ DB ; // During create. if ( ! $ this -> get ( 'id' ) ) { // Check that the user exists. We do not need to do that on update because // the userid of a plan should never change. if ( ! $ DB -> record_exists ( 'user' , array ( 'id' => $ value ) ) ) { return new lang_string ( 'invaliddata' , 'error' ) ; } } return true ; }
docstring: Validate the user ID.
  
  @param  int $value
  @return true|lang_string
docstring_tokens: Validate the user ID .