Fetching all section activities from get_fast_modinfo()

Fetching all section activities from get_fast_modinfo()

von Ashish Jain -
Anzahl Antworten: 1

Hello,

How can I fetch the details in proper format i.e. all section and their activiites/resources. When I print the get_fast_modinfo() using print_object(), I get very complex object array structure, I need to navigate through it to fetch relevant details. Somebody, please provide me with the solution

Thanks

Als Antwort auf Ashish Jain

Re: Fetching all section activities from get_fast_modinfo()

von Davo Smith -
Nutzerbild von Core developers Nutzerbild von Particularly helpful Moodlers Nutzerbild von Peer reviewers Nutzerbild von Plugin developers

Have you read through the extensive comments in lib/modinfolib.php, both in the course_modinfo class (returned by get_fast_modinfo) and the cm_info class (returned by  $modinfo->get_cm() & $modinfo->get_cms())?

You could also try searching for examples of how get_fast_modinfo is used in core Moodle code - as there's probably some code in there that already does more or less what you are looking to do.