protected function plugin_extend_coursemodule_validation($data) {
        $errors = array();

        $callbacks = get_plugins_with_function('coursemodule_validation', 'lib.php');
        foreach ($callbacks as $type => $plugins) {
            foreach ($plugins as $plugin => $pluginfunction) {
                // We have exposed all the important properties with public getters - the errors array should be pass by reference.
                $pluginerrors = $pluginfunction($this, $data);
                if (!empty($pluginerrors)) {
                    $errors = array_merge($errors, $pluginerrors);
                }
            }
        }
        return $errors;
    }
protected function plugin_extend_coursemodule_validation($data) {
        $errors = array();

        $callbacks = get_plugins_with_function('coursemodule_validation', 'lib.php');
        foreach ($callbacks as $type => $plugins) {
            foreach ($plugins as $plugin => $pluginfunction) {
                // We have exposed all the important properties with public getters - the errors array should be pass by reference.
                $pluginerrors = $pluginfunction($this, $data);
                if (!empty($pluginerrors)) {
                    $errors = array_merge($errors, $pluginerrors);
                }
            }
        }
        return $errors;
    }
protected function plugin_extend_coursemodule_validation ( $ data ) { $ errors = array ( ) ; $ callbacks = get_plugins_with_function ( 'coursemodule_validation' , 'lib.php' ) ; foreach ( $ callbacks as $ type => $ plugins ) { foreach ( $ plugins as $ plugin => $ pluginfunction ) { // We have exposed all the important properties with public getters - the errors array should be pass by reference. $ pluginerrors = $ pluginfunction ( $ this , $ data ) ; if ( ! empty ( $ pluginerrors ) ) { $ errors = array_merge ( $ errors , $ pluginerrors ) ; } } } return $ errors ; }
Extend the validation function from any other plugin.

@param stdClass $data The form data.
@return array $errors The list of errors keyed by element name.
Extend the validation function from any other plugin .