Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Class for exporting path_node data. More...
Public Member Functions | |
__construct ($data, $related=array()) | |
Constructor - saves the persistent object, and the related objects. More... | |
export (renderer_base $output) | |
Function to export the renderer data in a format that is suitable for a mustache template. More... | |
Static Public Member Functions | |
static | format_properties ($properties) |
Recursively formats a given property definition with the default fields required. More... | |
static | get_create_structure () |
Returns the create structure. More... | |
static | get_read_structure () |
Returns the read structure. More... | |
static | get_update_structure () |
Returns the update structure. More... | |
static | properties_definition () |
Get the properties definition of this exporter used for create, and update structures. More... | |
static | read_properties_definition () |
Get the read properties definition of this exporter. More... | |
Protected Member Functions | |
get_format_parameters ($property) | |
Get the format parameters. More... | |
get_other_values (renderer_base $output) | |
Get the additional values to inject while exporting. More... | |
Static Protected Member Functions | |
static | define_other_properties () |
Return the list of additional properties used only for display. More... | |
static | define_properties () |
Return the list of properties. More... | |
static | define_related () |
Return the list of properties. More... | |
static | get_context_structure () |
Get the context structure. More... | |
static | get_format_field ($definitions, $property) |
Get the format field name. More... | |
static | get_format_structure ($property, $definition, $required=VALUE_REQUIRED) |
Get the format structure. More... | |
static | get_read_structure_from_properties ($properties, $required=VALUE_REQUIRED, $default=null) |
Returns the read structure from a set of properties (recursive). More... | |
Protected Attributes | |
stdClass array | $data = null |
The data of this exporter. | |
array | $related = array() |
$related List of related objects used to avoid DB queries. | |
Class for exporting path_node data.
tool_lp\external\path_node_exporter::__construct | ( | $data, | |
$related = array() |
|||
) |
Constructor - saves the persistent object, and the related objects.
mixed | $data | The data. |
array | $related | Array of relateds. |
Reimplemented from core\external\exporter.
|
staticprotectedinherited |
Return the list of additional properties used only for display.
Additional properties are only ever used for the read structure, and during export of the persistent data.
The format of the array returned by this method has to match the structure defined in core::persistent::define_properties(). The display properties can however do some more fancy things. They can define 'multiple' => true to wrap values in an external_multiple_structure automatically - or they can define the type as a nested array of more properties in order to generate a nested external_single_structure.
You can specify an array of values by including a 'multiple' => true array value. This will result in a nested external_multiple_structure. E.g.
'arrayofbools' => array( 'type' => PARAM_BOOL, 'multiple' => true ),
You can return a nested array in the type field, which will result in a nested external_single_structure. E.g. 'competency' => array( 'type' => competency_exporter::read_properties_definition() ),
Other properties can be specifically marked as optional, in which case they do not need to be included in the export in self::get_other_values(). This is useful when exporting a substructure which cannot be set as null due to webservices protocol constraints. E.g. 'competency' => array( 'type' => competency_exporter::read_properties_definition(), 'optional' => true ),
array |
Reimplemented in tool_dataprivacy\external\data_request_exporter, tool_dataprivacy\external\purpose_exporter, tool_lp\external\competency_path_exporter, tool_lp\external\competency_summary_exporter, tool_lp\external\course_competency_statistics_exporter, tool_lp\external\template_statistics_exporter, tool_lp\external\user_competency_summary_exporter, tool_lp\external\user_competency_summary_in_course_exporter, tool_lp\external\user_competency_summary_in_plan_exporter, tool_lp\external\user_evidence_competency_summary_exporter, tool_lp\external\user_evidence_summary_exporter, tool_policy\policy_exporter, tool_policy\policy_version_exporter, core_badges\external\assertion_exporter, core_badges\external\badgeclass_exporter, core_badges\external\user_badge_exporter, block_recentlyaccesseditems\external\recentlyaccesseditems_item_exporter, core_blog\external\post_exporter, core_calendar\external\calendar_day_exporter, core_calendar\external\calendar_event_exporter, core_calendar\external\calendar_upcoming_exporter, core_calendar\external\day_exporter, core_calendar\external\event_action_exporter, core_calendar\external\event_exporter, core_calendar\external\event_exporter_base, core_calendar\external\events_exporter, core_calendar\external\events_grouped_by_course_exporter, core_calendar\external\events_same_course_exporter, core_calendar\external\footer_options_exporter, core_calendar\external\month_exporter, core_calendar\external\week_day_exporter, core_calendar\external\week_exporter, core_cohort\external\cohort_summary_exporter, core_comment\external\comment_area_exporter, core_competency\external\competency_framework_exporter, core_competency\external\evidence_exporter, core_competency\external\plan_exporter, core_competency\external\template_exporter, core_competency\external\user_competency_course_exporter, core_competency\external\user_competency_exporter, core_competency\external\user_competency_plan_exporter, core_competency\external\user_evidence_exporter, core_course\external\course_module_summary_exporter, core_course\external\course_summary_exporter, core_course\local\exporters\course_content_item_exporter, core_files\external\stored_file_exporter, core\external\coursecat_summary_exporter, core\external\paged_content_exporter, mod_data\external\content_exporter, mod_data\external\database_summary_exporter, mod_data\external\record_exporter, mod_feedback\external\feedback_item_exporter, mod_feedback\external\feedback_summary_exporter, mod_forum\local\exporters\author, mod_forum\local\exporters\discussion, mod_forum\local\exporters\discussion_summaries, mod_forum\local\exporters\discussion_summary, mod_forum\local\exporters\forum, mod_forum\local\exporters\group, mod_forum\local\exporters\post, mod_forum\local\exporters\posts, mod_h5pactivity\external\h5pactivity_summary_exporter, mod_lesson\external\lesson_summary_exporter, mod_workshop\external\assessment_exporter, mod_workshop\external\submission_exporter, mod_workshop\external\workshop_summary_exporter, core_question\external\question_summary_exporter, core_tag\external\tag_area_exporter, and core_user\external\user_summary_exporter.
|
staticprotected |
|
staticprotected |
|
finalinherited |
Function to export the renderer data in a format that is suitable for a mustache template.
This means raw records are generated as in to_record, but all strings are correctly passed through external_format_text (or external_format_string).
renderer_base | $output | Used to do a final render of any components that need to be rendered for export. |
stdClass |
|
staticfinalinherited |
Recursively formats a given property definition with the default fields required.
array | $properties | List of properties to format |
array | Formatted array |
|
staticfinalprotectedinherited |
Get the context structure.
external_single_structure |
|
staticfinalinherited |
Returns the create structure.
external_single_structure |
|
staticfinalprotectedinherited |
Get the format field name.
array | $definitions | List of properties definitions. |
string | $property | The name of the property that may have a format field. |
bool|string | False, or the name of the format property. |
|
finalprotectedinherited |
Get the format parameters.
This method returns the parameters to use with the functions external_format_text(), and external_format_string(). To override the default parameters, you can define a protected method called 'get_format_parameters_for_<propertyName>'. For example, 'get_format_parameters_for_description', if your property is 'description'.
Your method must return an array containing any of the following keys:
string | $property | The property to get the parameters for. |
array |
|
staticfinalprotectedinherited |
Get the format structure.
string | $property | The name of the property on which the format applies. |
array | $definition | The definition of the format property. |
int | $required | Constant VALUE_*. |
external_format_value |
|
protectedinherited |
Get the additional values to inject while exporting.
These are additional generated values that are not passed in through $data to the exporter. For a persistent exporter - these are generated values that do not exist in the persistent class. For your convenience the format_text or format_string functions do not need to be applied to PARAM_TEXT fields, it will be done automatically during export.
These values are only used when returning data via self::export(), they are not used when generating any of the different external structures.
Note: These must be defined in self::define_other_properties().
renderer_base | $output | The renderer. |
array | Keys are the property names, values are their values. |
Reimplemented in tool_dataprivacy\external\data_request_exporter, tool_dataprivacy\external\purpose_exporter, tool_lp\external\competency_path_exporter, tool_lp\external\competency_summary_exporter, tool_lp\external\course_competency_statistics_exporter, tool_lp\external\template_statistics_exporter, tool_lp\external\user_competency_summary_exporter, tool_lp\external\user_competency_summary_in_course_exporter, tool_lp\external\user_competency_summary_in_plan_exporter, tool_lp\external\user_evidence_competency_summary_exporter, tool_lp\external\user_evidence_summary_exporter, tool_policy\policy_exporter, tool_policy\policy_version_exporter, core_badges\external\assertion_exporter, core_badges\external\badgeclass_exporter, core_badges\external\user_badge_exporter, block_recentlyaccesseditems\external\recentlyaccesseditems_item_exporter, core_blog\external\post_exporter, core_calendar\external\calendar_day_exporter, core_calendar\external\calendar_event_exporter, core_calendar\external\calendar_upcoming_exporter, core_calendar\external\day_exporter, core_calendar\external\event_action_exporter, core_calendar\external\event_exporter, core_calendar\external\event_exporter_base, core_calendar\external\events_exporter, core_calendar\external\events_grouped_by_course_exporter, core_calendar\external\events_same_course_exporter, core_calendar\external\footer_options_exporter, core_calendar\external\month_exporter, core_calendar\external\week_day_exporter, core_calendar\external\week_exporter, core_cohort\external\cohort_summary_exporter, core_comment\external\comment_area_exporter, core_competency\external\competency_framework_exporter, core_competency\external\evidence_exporter, core_competency\external\plan_exporter, core_competency\external\template_exporter, core_competency\external\user_competency_course_exporter, core_competency\external\user_competency_exporter, core_competency\external\user_competency_plan_exporter, core_competency\external\user_evidence_exporter, core_course\external\course_module_summary_exporter, core_course\external\course_summary_exporter, core_files\external\stored_file_exporter, core\external\coursecat_summary_exporter, core\external\paged_content_exporter, mod_data\external\content_exporter, mod_data\external\database_summary_exporter, mod_data\external\record_exporter, mod_feedback\external\feedback_item_exporter, mod_feedback\external\feedback_summary_exporter, mod_forum\local\exporters\author, mod_forum\local\exporters\discussion, mod_forum\local\exporters\discussion_summaries, mod_forum\local\exporters\discussion_summary, mod_forum\local\exporters\forum, mod_forum\local\exporters\group, mod_forum\local\exporters\post, mod_forum\local\exporters\posts, mod_h5pactivity\external\h5pactivity_summary_exporter, mod_lesson\external\lesson_summary_exporter, mod_workshop\external\assessment_exporter, mod_workshop\external\submission_exporter, mod_workshop\external\workshop_summary_exporter, core_tag\external\tag_area_exporter, and core_user\external\user_summary_exporter.
|
staticfinalinherited |
Returns the read structure.
external_single_structure |
|
staticfinalprotectedinherited |
Returns the read structure from a set of properties (recursive).
array | $properties | The properties. |
int | $required | Whether is required. |
mixed | $default | The default value. |
external_single_structure |
|
staticfinalinherited |
Returns the update structure.
This structure can never be included at the top level for an external function signature because it contains optional parameters.
external_single_structure |
|
staticfinalinherited |
Get the properties definition of this exporter used for create, and update structures.
The read structures are returned by: self::read_properties_definition().
array | Keys are the property names, and value their definition. |
|
staticfinalinherited |
Get the read properties definition of this exporter.
Read properties combines the default properties from the model (persistent or stdClass) with the properties defined by self::define_other_properties().
array | Keys are the property names, and value their definition. |