external functions

Re: external functions

by David Mudrák -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

It took me a while to figure out that in the database the field is 'methodname' not 'name' and the search fails.

There are both "name" and "methodname" fields in that table.

  • The "name" holds the name of your external function. That is the one that is used as a key in the $functions array in the db/services.php file in your plugin.
  • The "methodname" is also defined in that file and it defines the name of the method in the class (defined via the "classname" field) to call to execute this external function.

Please note, there are certain rules / guidelines for naming the external functions - https://docs.moodle.org/dev/Web_service_API_functions#Naming_convention. Your function should have your plugin component name as a prefix - for example something like mod_mywebinar_create_host

In reply to David Mudrák

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.