|
Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Classes | |
| class | data_file_info_container |
| Class representing the virtual node with all itemids in the file browser. More... | |
| class | data_portfolio_caller |
| The class to handle entry exports of a database module. More... | |
Functions | |
| data_add_fields_contents_to_new_record ($data, $context, $recordid, $fields, $datarecord, $processeddata) | |
| Populate the field contents of a new record with the submitted data. | |
| data_approve_entry ($entryid, $approve) | |
| Approves or unapproves an entry. | |
| data_build_search_array ($data, $paging, $searcharray, $defaults=null, $fn='', $ln='') | |
| Build the search array. | |
| data_can_view_record ($data, $record, $currentgroup, $canmanageentries) | |
| Check if the current user can view the given record. | |
| data_get_entries_left_to_add ($data, $numentries, $canmanageentries) | |
| Return the number of entries left to add to complete the activity. | |
| data_get_entries_left_to_view ($data, $numentries, $canmanageentries) | |
| Return the number of entires left to add to view other users entries. | |
| data_get_field_instances ($data) | |
| Return all the field instances for a given database. | |
| data_get_tag_title_field ($dataid) | |
| Get the title of a field to show when displaying tag results. | |
| data_get_tag_title_for_entry ($field, $entry) | |
| Get the title of an entry to show when displaying tag results. | |
| data_get_time_availability_status ($data, $canmanageentries=null, $context=null) | |
| Check if a database is available for the current user. | |
| data_require_time_available ($data, $canmanageentries=null, $context=null) | |
| Requires a database to be available for the current user. | |
| data_search_entries ($data, $cm, $context, $mode, $currentgroup, $search='', $sort=null, $order=null, $page=0, $perpage=0, $advanced=null, $searcharray=null, $record=null) | |
| Search entries in a database. | |
| data_set_events ($data) | |
| This creates new calendar events given as timeavailablefrom and timeclose by $data. | |
| data_update_record_fields_contents ($data, $record, $context, $datarecord, $processeddata) | |
| Updates the fields contents of an existing record. | |
| mod_data_get_tagged_records ($tag, $exclusivemode=false, $fromctx=0, $ctx=0, $rec=true, $page=0) | |
| Returns data records tagged with a specified tag. | |
| data_add_fields_contents_to_new_record | ( | $data, | |
| $context, | |||
| $recordid, | |||
| $fields, | |||
| $datarecord, | |||
| $processeddata ) |
Populate the field contents of a new record with the submitted data.
An event has been previously triggered upon the creation of the new record in data_add_record().
| stdClass | $data | database object |
| stdClass | $context | context object |
| int | $recordid | the new record id |
| array | $fields | list of fields of the database |
| stdClass | $datarecord | the submitted data |
| stdClass | $processeddata | pre-processed submitted fields |
| data_approve_entry | ( | $entryid, | |
| $approve ) |
Approves or unapproves an entry.
| int | $entryid | the entry to approve or unapprove. |
| bool | $approve | Whether to approve or unapprove (true for approve false otherwise). |
| data_build_search_array | ( | $data, | |
| $paging, | |||
| $searcharray, | |||
| $defaults = null, | |||
| $fn = '', | |||
| $ln = '' ) |
Build the search array.
| stdClass | $data | the database object |
| bool | $paging | if paging is being used |
| array | $searcharray | the current search array (saved by session) |
| array | $defaults | default values for the searchable fields |
| str | $fn | the first name to search (optional) |
| str | $ln | the last name to search (optional) |
| array | the search array and plain search build based on the different elements |
| data_can_view_record | ( | $data, | |
| $record, | |||
| $currentgroup, | |||
| $canmanageentries ) |
Check if the current user can view the given record.
| stdClass | $data | database record |
| stdClass | $record | the record (entry) to check |
| int | $currentgroup | current group |
| bool | $canmanageentries | if the user can manage entries |
| bool | true if the user can view the entry |
| data_get_entries_left_to_add | ( | $data, | |
| $numentries, | |||
| $canmanageentries ) |
Return the number of entries left to add to complete the activity.
| stdClass | $data | database object |
| int | $numentries | the number of entries the current user has created |
| bool | $canmanageentries | whether the user can manage entries (teachers, managers) |
| int | the number of entries left, 0 if no entries left or if is not required |
| data_get_entries_left_to_view | ( | $data, | |
| $numentries, | |||
| $canmanageentries ) |
Return the number of entires left to add to view other users entries.
| stdClass | $data | database object |
| int | $numentries | the number of entries the current user has created |
| bool | $canmanageentries | whether the user can manage entries (teachers, managers) |
| int | the number of entries left, 0 if no entries left or if is not required |
| data_get_field_instances | ( | $data | ) |
Return all the field instances for a given database.
| stdClass | $data | database object |
| array | field instances |
| data_get_tag_title_field | ( | $dataid | ) |
Get the title of a field to show when displaying tag results.
| int | $dataid | The id of the data field |
| stdClass | The field data from the 'data_fields' table as well as it's priority |
| data_get_tag_title_for_entry | ( | $field, | |
| $entry ) |
Get the title of an entry to show when displaying tag results.
| stdClass | $field | The field from the 'data_fields' table |
| stdClass | $entry | The entry from the 'data_records' table |
| string|null | It will return the title of the entry or null if the field type is not available. |
| data_get_time_availability_status | ( | $data, | |
| $canmanageentries = null, | |||
| $context = null ) |
Check if a database is available for the current user.
| stdClass | $data | database record |
| boolean | $canmanageentries | optional, if the user can manage entries |
| stdClass | $context | Module context, required if $canmanageentries is not set |
| array | status (available or not and possible warnings) |
| data_require_time_available | ( | $data, | |
| $canmanageentries = null, | |||
| $context = null ) |
Requires a database to be available for the current user.
| stdClass | $data | database record |
| boolean | $canmanageentries | optional, if the user can manage entries |
| stdClass | $context | Module context, required if $canmanageentries is not set |
| moodle_exception |
| data_search_entries | ( | $data, | |
| $cm, | |||
| $context, | |||
| $mode, | |||
| $currentgroup, | |||
| $search = '', | |||
| $sort = null, | |||
| $order = null, | |||
| $page = 0, | |||
| $perpage = 0, | |||
| $advanced = null, | |||
| $searcharray = null, | |||
| $record = null ) |
Search entries in a database.
| stdClass | $data | database object |
| stdClass | $cm | course module object |
| stdClass | $context | context object |
| stdClass | $mode | in which mode we are viewing the database (list, single) |
| int | $currentgroup | the current group being used |
| str | $search | search for this text in the entry data |
| str | $sort | the field to sort by |
| str | $order | the order to use when sorting |
| int | $page | for pagination, the current page |
| int | $perpage | entries per page |
| bool | $advanced | whether we are using or not advanced search |
| array | $searcharray | when using advanced search, the advanced data to use |
| stdClass | $record | if we jsut want this record after doing all the access checks |
| array | the entries found among other data related to the search |
| data_set_events | ( | $data | ) |
This creates new calendar events given as timeavailablefrom and timeclose by $data.
| stdClass | $data |
| void |
| data_update_record_fields_contents | ( | $data, | |
| $record, | |||
| $context, | |||
| $datarecord, | |||
| $processeddata ) |
Updates the fields contents of an existing record.
| stdClass | $data | database object |
| stdClass | $record | record to update object |
| stdClass | $context | context object |
| stdClass | $datarecord | the submitted data |
| stdClass | $processeddata | pre-processed submitted fields |
| mod_data_get_tagged_records | ( | $tag, | |
| $exclusivemode = false, | |||
| $fromctx = 0, | |||
| $ctx = 0, | |||
| $rec = true, | |||
| $page = 0 ) |
Returns data records tagged with a specified tag.
This is a callback used by the tag area mod_data/data_records to search for data records tagged with a specific tag.
| core_tag_tag | $tag | |
| bool | $exclusivemode | if set to true it means that no other entities tagged with this tag are displayed on the page and the per-page limit may be bigger |
| int | $fromctx | context id where the link was displayed, may be used by callbacks to display items in the same context first |
| int | $ctx | context id where to search for records |
| bool | $rec | search in subcontexts as well |
| int | $page | 0-based number of page being displayed |
| core_tag\output\tagindex |