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);
            }
        }
    }
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);
            }
        }
    }
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 ) ; } } }
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.
Update the database to contain a list of handlers for a component adding any handlers which do not exist in the database .