protected static function create_config_record($extension, $mimetype,
            $coreicon, array $groups, $corestring, $customdescription, $defaulticon) {
        // Construct new entry.
        $newentry = (object)array('extension' => (string)$extension, 'type' => (string)$mimetype,
                'icon' => (string)$coreicon);
        if ($groups) {
            if (!is_array($groups)) {
                throw new coding_exception('Groups must be an array');
            }
            foreach ($groups as $group) {
                if (!is_string($group)) {
                    throw new coding_exception('Groups must be an array of strings');
                }
            }
            $newentry->groups = $groups;
        }
        if ($corestring) {
            $newentry->string = (string)$corestring;
        }
        if ($customdescription) {
            $newentry->customdescription = (string)$customdescription;
        }
        if ($defaulticon) {
            $newentry->defaulticon = true;
        }
        return $newentry;
    }
protected static function create_config_record($extension, $mimetype,
            $coreicon, array $groups, $corestring, $customdescription, $defaulticon) {
        // Construct new entry.
        $newentry = (object)array('extension' => (string)$extension, 'type' => (string)$mimetype,
                'icon' => (string)$coreicon);
        if ($groups) {
            if (!is_array($groups)) {
                throw new coding_exception('Groups must be an array');
            }
            foreach ($groups as $group) {
                if (!is_string($group)) {
                    throw new coding_exception('Groups must be an array of strings');
                }
            }
            $newentry->groups = $groups;
        }
        if ($corestring) {
            $newentry->string = (string)$corestring;
        }
        if ($customdescription) {
            $newentry->customdescription = (string)$customdescription;
        }
        if ($defaulticon) {
            $newentry->defaulticon = true;
        }
        return $newentry;
    }
protected static function create_config_record ( $ extension , $ mimetype , $ coreicon , array $ groups , $ corestring , $ customdescription , $ defaulticon ) { // Construct new entry. $ newentry = ( object ) array ( 'extension' => ( string ) $ extension , 'type' => ( string ) $ mimetype , 'icon' => ( string ) $ coreicon ) ; if ( $ groups ) { if ( ! is_array ( $ groups ) ) { throw new coding_exception ( 'Groups must be an array' ) ; } foreach ( $ groups as $ group ) { if ( ! is_string ( $ group ) ) { throw new coding_exception ( 'Groups must be an array of strings' ) ; } } $ newentry -> groups = $ groups ; } if ( $ corestring ) { $ newentry -> string = ( string ) $ corestring ; } if ( $ customdescription ) { $ newentry -> customdescription = ( string ) $ customdescription ; } if ( $ defaulticon ) { $ newentry -> defaulticon = true ; } return $ newentry ; }
Converts function parameters into a record for storing in the JSON value.

@param string $extension File extension without dot, e.g. 'doc'
@param string $mimetype MIME type e.g. 'application/msword'
@param string $coreicon Core icon to use e.g. 'document'
@param array $groups Array of group strings that this type belongs to
@param string $corestring Custom lang string name in mimetypes.php
@param string $customdescription Custom description (plain text/multilang)
@param bool $defaulticon True if this should be the default icon for the type
@return stdClass Record matching the parameters
Converts function parameters into a record for storing in the JSON value .