Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
core_customfield_generator Class Reference
Inheritance diagram for core_customfield_generator:
component_generator_base

Public Member Functions

 add_instance_data (field_controller $field, int $instanceid, $value)
 Adds instance data for one field. More...
 
 create_category ($record=null)
 Create a new category. More...
 
 create_field ($record)
 Create a new field. More...
 
 reset ()
 To be called from data reset code only, do not use in tests. More...
 

Protected Member Functions

 set_user (?stdClass $user=null)
 Set the current user during data generation. More...
 

Protected Attributes

int $categorycount = 0
 Number of created categories.
 
testing_data_generator $datagenerator
 
int $fieldcount = 0
 Number of created fields.
 

Member Function Documentation

◆ add_instance_data()

core_customfield_generator::add_instance_data ( field_controller  $field,
int  $instanceid,
  $value 
)

Adds instance data for one field.

Parameters
field_controller$field
int$instanceid
mixed$value
Return values
core_customfield::data_controller

◆ create_category()

core_customfield_generator::create_category (   $record = null)

Create a new category.

Parameters
array | stdClass$record
Return values
category_controller

◆ create_field()

core_customfield_generator::create_field (   $record)

Create a new field.

Parameters
array | stdClass$record
Return values
field_controller

◆ reset()

component_generator_base::reset ( )
inherited

◆ set_user()

component_generator_base::set_user ( ?stdClass  $user = null)
protectedinherited

Set the current user during data generation.

This should be avoided wherever possible, but in some situations underlying code will insert data as the current user.

Parameters
stdClass$user

The documentation for this class was generated from the following file: