original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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.
docstring_tokens: Extend the validation function from any other plugin .