Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
profile_field_checkbox Class Reference
Inheritance diagram for profile_field_checkbox:

Public Member Functions

 display_data ()
 Display the data for this field.
 
 edit_field_add ($mform)
 Add elements for editing the profile field value.
 
 get_field_properties ()
 Return the field type and null properties.
 
 is_empty ()
 Override parent {.
 
 show_field_content (?context $context=null)
 Override parent {.
 

Member Function Documentation

◆ display_data()

profile_field_checkbox::display_data ( )

Display the data for this field.

Return values
stringHTML.

◆ edit_field_add()

profile_field_checkbox::edit_field_add ( $mform)

Add elements for editing the profile field value.

Parameters
moodleform$mform

◆ get_field_properties()

profile_field_checkbox::get_field_properties ( )

Return the field type and null properties.

This will be used for validating the data submitted by a user.

Return values
arraythe param type and null property
Since
Moodle 3.2

◆ is_empty()

profile_field_checkbox::is_empty ( )

Override parent {.

See also
profile_field_base\is_empty} check

We can't check the "data" property, because if not set by the user then it's populated by "defaultdata" of the field, which can also be 0 (false) therefore ensuring the parent class check could never return true for this comparison

Return values
bool

◆ show_field_content()

profile_field_checkbox::show_field_content ( ?context $context = null)

Override parent {.

See also
profile_field_base\show_field_content} check

We only need to determine whether the field is visible, because we also want to show the "defaultdata" of the field, even if the user hasn't explicitly filled it in

Parameters
context | null$context
Return values
bool

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