Fetching all section activities from get_fast_modinfo()

Fetching all section activities from get_fast_modinfo()

by Ashish Jain -
Number of replies: 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

Average of ratings: -
In reply to Ashish Jain

Re: Fetching all section activities from get_fast_modinfo()

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of 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.

Average of ratings: Useful (1)