General developer forum

cohort functions

 
Picture of Marios Theo
cohort functions
 

Hello people, 

I was wondering whether there are functions in moodle that have the same functionality as the webservices below. I am in process of implementing a script and i don't want to reinvent the wheel if there is something already developed. 

  • core_cohort_get_cohort_members
  • core_cohort_add_cohort_members

If there is no function i will have to go with the get_record api.

Thanking you in advance.

Marios

 
Average of ratings: -
Davo
Re: cohort functions
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Well, a very quick look in cohort/lib.php found:

cohort_add_member() (which is used directly by core_cohort_add_cohort_members)

I can't spot a specific cohort_get_members() function, but if you look at the definition of get_cohort_members() in cohort/externallib.php, then that would be very simple to implement.


 
Average of ratings: Useful (1)
Picture of Marios Theo
Re: cohort functions
 

Thank you very much for your help.

You saved me a lot of time smile

Marios

 
Average of ratings: -