| Moodle APIs 3.9
    Moodle 3.9.13+ (Build: 20220325) | 
 
  
| Public Member Functions | |
| generate_items (string $generatortype, TableNode $data, bool $singular=false) | |
| Do the work to generate an entity.  More... | |
| Protected Member Functions | |
| get_activity_id (string $idnumber) | |
| Gets the course cmid for the specified activity based on the activity's idnumber.  More... | |
| get_category_id ($idnumber) | |
| Gets the category id from it's idnumber.  More... | |
| get_cm_by_activity_name (string $activity, string $identifier) | |
| Get a coursemodule from an activity name or idnumber.  More... | |
| get_cohort_id ($idnumber) | |
| Gets the cohort id from it's idnumber.  More... | |
| get_contact_id ($username) | |
| Gets the contact id from it's username.  More... | |
| get_context ($levelname, $contextref) | |
| Gets the internal context id from the context reference.  More... | |
| get_course_id ($shortname) | |
| Gets the course id from it's shortname.  More... | |
| get_creatable_entities () | |
| Get a list of the entities that can be created for this component.  More... | |
| get_externalbackpack_id ($backpackweburl) | |
| Gets the external backpack id from it's backpackweburl.  More... | |
| get_gradecategory_id ($fullname) | |
| Gets the grade category id from the grade category fullname.  More... | |
| get_group_id ($idnumber) | |
| Gets the group id from it's idnumber.  More... | |
| get_grouping_id ($idnumber) | |
| Gets the grouping id from it's idnumber.  More... | |
| get_h5pactivity_id (string $h5pname) | |
| Look up the id of a h5p from its name.  More... | |
| get_outcome_id ($shortname) | |
| Gets the outcome item id from its shortname.  More... | |
| get_questioncategory_id ($name) | |
| Get the id of a named question category (must be globally unique).  More... | |
| get_role_id ($roleshortname) | |
| Gets the role id from it's shortname.  More... | |
| get_scale_id ($name) | |
| Get the id of a named scale.  More... | |
| get_user_id ($username) | |
| Gets the user id from it's username.  More... | |
| name_for_errors (string $entitytype) | |
| Helper for formatting error messages.  More... | |
| Protected Attributes | |
| string | $component | 
| the name of the component we belong to.  More... | |
| testing_data_generator | $componentdatagenerator | 
| the data generator for this component. | |
| testing_data_generator | $datagenerator | 
| the core data generator | |
| 
 | inherited | 
Do the work to generate an entity.
This is called by behat_data_generators::the_following_entities_exist().
| string | $generatortype | The name of the entity to create. | 
| TableNode | $data | from the step. | 
| bool | $singular | Whether there is only one record and it is pivotted | 
| 
 | protectedinherited | 
Gets the course cmid for the specified activity based on the activity's idnumber.
Note: this does not check the module type, only the idnumber.
| Exception | 
| string | $idnumber | 
| int | 
| 
 | protectedinherited | 
Gets the category id from it's idnumber.
| Exception | 
| string | $idnumber | 
| int | 
| 
 | protectedinherited | 
Get a coursemodule from an activity name or idnumber.
| string | $activity | |
| string | $identifier | 
| cm_info | 
| 
 | protectedinherited | 
Gets the cohort id from it's idnumber.
| Exception | 
| string | $idnumber | 
| int | 
| 
 | protectedinherited | 
Gets the contact id from it's username.
| Exception | 
| string | $username | 
| int | 
| 
 | protectedinherited | 
Gets the internal context id from the context reference.
The context reference changes depending on the context level, it can be the system, a user, a category, a course or a module.
| Exception | 
| string | $levelname | The context level string introduced by the test writer | 
| string | $contextref | The context reference introduced by the test writer | 
| context | 
| 
 | protectedinherited | 
Gets the course id from it's shortname.
| Exception | 
| string | $shortname | 
| int | 
| 
 | protected | 
Get a list of the entities that can be created for this component.
This function must be overridden in subclasses. See class comment above for a description of the data structure. See behat_core_generator for an example.
| array | entity name => information about how to generate. | 
Reimplemented from behat_generator_base.
| 
 | protectedinherited | 
Gets the external backpack id from it's backpackweburl.
| string | $backpackweburl | 
| mixed | 
| dml_exception | 
| 
 | protectedinherited | 
Gets the grade category id from the grade category fullname.
| string | $fullname | the grade category name. | 
| int | corresponding id. | 
| 
 | protectedinherited | 
Gets the group id from it's idnumber.
| Exception | 
| string | $idnumber | 
| int | 
| 
 | protectedinherited | 
Gets the grouping id from it's idnumber.
| Exception | 
| string | $idnumber | 
| int | 
| 
 | protected | 
Look up the id of a h5p from its name.
| string | $h5pname | the activity name, for example 'Test h5p'. | 
| int | corresponding id | 
| 
 | protectedinherited | 
Gets the outcome item id from its shortname.
| Exception | 
| string | $shortname | 
| int | 
| 
 | protectedinherited | 
Get the id of a named question category (must be globally unique).
Note that 'Top' is a special value, used when setting the parent of another category, meaning top-level.
| string | $name | the question category name. | 
| int | the question category id. | 
| 
 | protectedinherited | 
Gets the role id from it's shortname.
| Exception | 
| string | $roleshortname | 
| int | 
| 
 | protectedinherited | 
Get the id of a named scale.
| string | $name | the name of the scale. | 
| int | the scale id. | 
| 
 | protectedinherited | 
Gets the user id from it's username.
| Exception | 
| string | $username | 
| int | 
| 
 | protectedinherited | 
Helper for formatting error messages.
| string | $entitytype | entity type without prefix, e.g. 'frog'. | 
| string | either 'frog' for core entities, or 'mod_mymod > frog' for components. | 
| 
 | protectedinherited | 
the name of the component we belong to.
This should probably only be used to make error messages clearer.