Class profile_field_menu.
More...
|
int | $datakey |
| $datakey
|
|
array | $options |
| $options
|
|
Class profile_field_menu.
- Copyright
- 2007 onwards Shane Elliot
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
profile_field_menu::__construct |
( |
| $fieldid = 0, |
|
|
| $userid = 0, |
|
|
| $fielddata = null ) |
Constructor method.
Pulls out the options for the menu from the database and sets the the corresponding key for the data if it exists.
- Parameters
-
int | $fieldid | |
int | $userid | |
object | $fielddata | |
◆ convert_external_data()
profile_field_menu::convert_external_data |
( |
| $value | ) |
|
Convert external data (csv file) from value to key for processing later by edit_save_data_preprocess.
- Parameters
-
string | $value | one of the values in menu options. |
- Return values
-
int | options key for the menu |
◆ edit_field_add()
profile_field_menu::edit_field_add |
( |
| $mform | ) |
|
Create the code snippet for this field instance Overwrites the base class method.
- Parameters
-
moodleform | $mform | Moodle form instance |
◆ edit_field_set_default()
profile_field_menu::edit_field_set_default |
( |
| $mform | ) |
|
Set the default value for this field instance Overwrites the base class method.
- Parameters
-
moodleform | $mform | Moodle form instance |
◆ edit_field_set_locked()
profile_field_menu::edit_field_set_locked |
( |
| $mform | ) |
|
HardFreeze the field if locked.
- Parameters
-
moodleform | $mform | instance of the moodleform class |
◆ edit_load_user_data()
profile_field_menu::edit_load_user_data |
( |
| $user | ) |
|
When passing the user object to the form class for the edit profile page we should load the key for the saved data.
Overwrites the base class method.
- Parameters
-
stdClass | $user | User object. |
◆ edit_save_data_preprocess()
profile_field_menu::edit_save_data_preprocess |
( |
| $data, |
|
|
| $datarecord ) |
The data from the form returns the key.
This should be converted to the respective option string to be saved in database Overwrites base class accessor method.
- Parameters
-
mixed | $data | The key returned from the select input in the form |
stdClass | $datarecord | The object that will be used to save the record |
- Return values
-
◆ get_field_config_for_external()
profile_field_menu::get_field_config_for_external |
( |
| ) |
|
Return the field settings suitable to be exported via an external function.
- Return values
-
◆ get_field_properties()
profile_field_menu::get_field_properties |
( |
| ) |
|
Return the field type and null properties.
This will be used for validating the data submitted by a user.
- Return values
-
array | the param type and null property |
- Since
- Moodle 3.2
The documentation for this class was generated from the following file:
- user/profile/field/menu/field.class.php