Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-46155

Core method to retrieve list of classes


    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.7
    • General
      1. Open report_eventlist
      2. Try filtering, clicking on elements, make sure everything works as expected

      I saw already two issues that need to retrieve list of classes in autoloaded locations, so I thought it would be very useful to have such methods in core.

      This issue introduces two new static functions:

      core_component::find_classes_in_plugins($plugintype, $subnamespace, $parentclass = null, $nonabstractonly = false);
      core_component::find_classes_in_components($componenttype, $subnamespace, $parentclass = null, $nonabstractonly = false);

      Where $plugintype has a mixed syntax and can be one of the following: 'mod'; 'mod_assign'; array('mod', 'block'); array('mod_assign','block_navigation); '*'
      $componenttype can be: 'core'; 'core_course'; array('core_course', 'core_availability'); '*'

      Using them core API can find plugins that implement it (as a faster and more structured alternative to callbacks). Since the list of classes in autoloaded locations is already cached, such call will be very fast even across multiple or all plugin and component types.
      Also as part of this issue the directory scanning in report_eventlist is replaced with those functions.

            Unassigned Unassigned
            marina Marina Glancy
            David Monllaó David Monllaó
            2 Vote for this issue
            9 Start watching this issue


                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.