original_string: public static function update_handlers_for_component($componentname) {
          global $DB;
  
          $componentname = \core_component::normalize_componentname($componentname);
          $existinghandlers = $DB->get_recordset('messageinbound_handlers', array('component' => $componentname));
          foreach ($existinghandlers as $handler) {
              if (!class_exists($handler->classname)) {
                  self::remove_messageinbound_handler($handler);
              }
          }
          $existinghandlers->close();
  
          self::create_missing_messageinbound_handlers_for_component($componentname);
      }
code: public static function update_handlers_for_component($componentname) {
          global $DB;
  
          $componentname = \core_component::normalize_componentname($componentname);
          $existinghandlers = $DB->get_recordset('messageinbound_handlers', array('component' => $componentname));
          foreach ($existinghandlers as $handler) {
              if (!class_exists($handler->classname)) {
                  self::remove_messageinbound_handler($handler);
              }
          }
          $existinghandlers->close();
  
          self::create_missing_messageinbound_handlers_for_component($componentname);
      }
code_tokens: public static function update_handlers_for_component ( $ componentname ) { global $ DB ; $ componentname = \ core_component :: normalize_componentname ( $ componentname ) ; $ existinghandlers = $ DB -> get_recordset ( 'messageinbound_handlers' , array ( 'component' => $ componentname ) ) ; foreach ( $ existinghandlers as $ handler ) { if ( ! class_exists ( $ handler -> classname ) ) { self :: remove_messageinbound_handler ( $ handler ) ; } } $ existinghandlers -> close ( ) ; self :: create_missing_messageinbound_handlers_for_component ( $ componentname ) ; }
docstring: Update the database to create, update, and remove handlers.
  
  @param string $componentname - The frankenstyle component name.
docstring_tokens: Update the database to create update and remove handlers .