public static function record_from_handler($handler) {
        $record = new \stdClass();
        $record->id = $handler->id;
        $record->component = $handler->component;
        $record->classname = get_class($handler);
        if (strpos($record->classname, '\\') !== 0) {
            $record->classname = '\\' . $record->classname;
        }
        $record->defaultexpiration = $handler->defaultexpiration;
        $record->validateaddress = $handler->validateaddress;
        $record->enabled = $handler->enabled;

        return $record;
    }