protected function create_file($newrecord) {
        global $DB;
        $newrecord->id = $DB->insert_record('files', $newrecord);

        if ($newrecord->filename !== '.') {
            // Callback for file created.
            if ($pluginsfunction = get_plugins_with_function('after_file_created')) {
                foreach ($pluginsfunction as $plugintype => $plugins) {
                    foreach ($plugins as $pluginfunction) {
                        $pluginfunction($newrecord);
                    }
                }
            }
        }
    }
protected function create_file($newrecord) {
        global $DB;
        $newrecord->id = $DB->insert_record('files', $newrecord);

        if ($newrecord->filename !== '.') {
            // Callback for file created.
            if ($pluginsfunction = get_plugins_with_function('after_file_created')) {
                foreach ($pluginsfunction as $plugintype => $plugins) {
                    foreach ($plugins as $pluginfunction) {
                        $pluginfunction($newrecord);
                    }
                }
            }
        }
    }
protected function create_file ( $ newrecord ) { global $ DB ; $ newrecord -> id = $ DB -> insert_record ( 'files' , $ newrecord ) ; if ( $ newrecord -> filename !== '.' ) { // Callback for file created. if ( $ pluginsfunction = get_plugins_with_function ( 'after_file_created' ) ) { foreach ( $ pluginsfunction as $ plugintype => $ plugins ) { foreach ( $ plugins as $ pluginfunction ) { $ pluginfunction ( $ newrecord ) ; } } } } }
Add new file record to database and handle callbacks.

@param stdClass $newrecord
Add new file record to database and handle callbacks .