Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
file_nested_element Class Reference

Implementation of backup_nested_element that provides special handling of files. More...

Inheritance diagram for file_nested_element:
backup_nested_element base_nested_element processable base_final_element base_atom

Public Member Functions

 add_attributes ($attributes)
 
 add_child ($element)
 
 add_final_elements ($final_elements)
 
 add_optigroup ($optigroup)
 
 annotate_files ($component, $filearea, $elementname, $filesctxid=null)
 
 annotate_ids ($itemname, $elementname)
 
 clean_value ()
 
 clean_values ()
 
 destroy ()
 Destroy all circular references. More...
 
 fill_values ($values)
 Simple filler that, matching by name, will fill both attributes and final elements depending of this nested element, debugging info about non-matching elements and/or elements present in both places. More...
 
 get_attribute ($name)
 
 get_attributes ()
 Public API starts here.
 
 get_child ($name)
 
 get_children ()
 
 get_counter ()
 
 get_file_annotations ()
 Returns one array containing the element in the @backup_structure and the areas to be searched.
 
 get_final_element ($name)
 
 get_final_elements ()
 Public API starts here.
 
 get_level ()
 
 get_logs ()
 Returns the logs. More...
 
 get_name ()
 Public API starts here.
 
 get_optigroup ()
 
 get_parent ()
 
 get_results ()
 Returns the results. More...
 
 get_source_array ()
 
 get_source_sql ()
 
 get_source_table ()
 
 get_source_table_sortby ()
 
 get_value ()
 
 is_set ()
 
 process ($processor)
 Process the nested element. More...
 
 set_source_alias ($dbname, $finalelementname)
 
 set_source_array ($arr)
 
 set_source_sql ($sql, $params)
 
 set_source_table ($table, $params, $sortby=null)
 
 set_value ($value)
 
 to_string ($showvalue=false)
 

Protected Member Functions

 add_log ($message, $level, $a=null, $depth=null, $display=false)
 Saves a log message to an array. More...
 
 add_result ($result)
 Saves the results to an array. More...
 
 add_used ($element)
 
 check_and_set_used ($element)
 
 convert_sql_params ($params)
 
 convert_table_params ($params)
 
 find_element ($param)
 
 find_element_by_path ($path)
 
 find_first_parent_by_name ($name)
 
 get_grandoptigroupelement_or_grandparent ()
 
 get_grandparent ()
 
 get_iterator ($processor)
 Returns one PHP iterator over each "ocurrence" of this nested element (array or DB recordset). More...
 
 get_new_attribute ($name)
 Returns one instace of the @base_attribute class to work with when attributes are added simply by name.
 
 get_new_final_element ($name)
 Returns one instace of the @final_element class to work with when final_elements are added simply by name.
 
 get_used ()
 
 set_parent ($element)
 
 set_used ($used)
 
 validate_name ($name)
 

Protected Attributes

 $aliases
 
 $backupid
 
 $counter
 
 $fileannotations
 
 $logs
 
 $params
 
 $procparams
 
 $results
 
 $sql
 
 $table
 
 $tablesortby
 
 $var_array
 

Detailed Description

Implementation of backup_nested_element that provides special handling of files.

This class overwrites the standard fill_values() method, so it gets intercepted for each file record being set to xml, in order to copy, at the same file, the physical file from moodle file storage to backup file storage

TODO: Finish phpdocs

Member Function Documentation

◆ add_log()

backup_nested_element::add_log (   $message,
  $level,
  $a = null,
  $depth = null,
  $display = false 
)
protectedinherited

Saves a log message to an array.

See also
backup_helper::log()
Parameters
string$messageto add to the logs
int$levellevel of importance backup::LOG_DEBUG and other constants
mixed$ato be included in $message
int$depthof the message
display$boolsupporting translation via get_string() if true
Return values
void

◆ add_result()

backup_nested_element::add_result (   $result)
protectedinherited

Saves the results to an array.

Parameters
array$resultassociative array
Return values
void

◆ destroy()

base_nested_element::destroy ( )
inherited

Destroy all circular references.

It helps PHP 5.2 a lot!

Reimplemented from base_final_element.

◆ fill_values()

file_nested_element::fill_values (   $values)

Simple filler that, matching by name, will fill both attributes and final elements depending of this nested element, debugging info about non-matching elements and/or elements present in both places.

Accept both arrays and objects.

Reimplemented from backup_nested_element.

◆ get_iterator()

backup_nested_element::get_iterator (   $processor)
protectedinherited

Returns one PHP iterator over each "ocurrence" of this nested element (array or DB recordset).

Delegated to backup_structure_dbops class

Reimplemented in backup_logstore_database_nested_element.

◆ get_logs()

backup_nested_element::get_logs ( )
inherited

Returns the logs.

Return values
arrayof log objects

◆ get_results()

backup_nested_element::get_results ( )
inherited

Returns the results.

Return values
associativearray of results

◆ process()

file_nested_element::process (   $processor)

Process the nested element.

Parameters
object$processorthe processor
Return values
void

Reimplemented from backup_nested_element.


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