original_string: public static function create_missing_messageinbound_handlers_for_component($componentname) {
          global $DB;
          $componentname = \core_component::normalize_componentname($componentname);
  
          $expectedhandlers = self::load_default_handlers_for_component($componentname);
          foreach ($expectedhandlers as $handler) {
              $recordexists = $DB->record_exists('messageinbound_handlers', array(
                  'component' => $componentname,
                  'classname' => $handler->classname,
              ));
  
              if (!$recordexists) {
                  $record = self::record_from_handler($handler);
                  $record->component = $componentname;
                  $DB->insert_record('messageinbound_handlers', $record);
              }
          }
      }
code: public static function create_missing_messageinbound_handlers_for_component($componentname) {
          global $DB;
          $componentname = \core_component::normalize_componentname($componentname);
  
          $expectedhandlers = self::load_default_handlers_for_component($componentname);
          foreach ($expectedhandlers as $handler) {
              $recordexists = $DB->record_exists('messageinbound_handlers', array(
                  'component' => $componentname,
                  'classname' => $handler->classname,
              ));
  
              if (!$recordexists) {
                  $record = self::record_from_handler($handler);
                  $record->component = $componentname;
                  $DB->insert_record('messageinbound_handlers', $record);
              }
          }
      }
code_tokens: public static function create_missing_messageinbound_handlers_for_component ( $ componentname ) { global $ DB ; $ componentname = \ core_component :: normalize_componentname ( $ componentname ) ; $ expectedhandlers = self :: load_default_handlers_for_component ( $ componentname ) ; foreach ( $ expectedhandlers as $ handler ) { $ recordexists = $ DB -> record_exists ( 'messageinbound_handlers' , array ( 'component' => $ componentname , 'classname' => $ handler -> classname , ) ) ; if ( ! $ recordexists ) { $ record = self :: record_from_handler ( $ handler ) ; $ record -> component = $ componentname ; $ DB -> insert_record ( 'messageinbound_handlers' , $ record ) ; } } }
docstring: Update the database to contain a list of handlers for a component,
  adding any handlers which do not exist in the database.
  
  @param string $componentname - The frankenstyle component name.
docstring_tokens: Update the database to contain a list of handlers for a component adding any handlers which do not exist in the database .