Data purpose form.  
 More...
|  | 
| static | convert_fields (\stdClass $data) | 
|  | Converts data to data suitable for storage. 
 | 
|  | 
|  | 
| array | $existingoverrides = [] | 
|  | The list of current overrides. 
 | 
|  | 
|  | 
| static string | $persistentclass = 'tool_dataprivacy\\purpose' | 
|  | The persistent class. 
 | 
|  | 
Data purpose form. 
- Copyright
- 2018 David Monllao 
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 
◆ add_field()
  
  | 
        
          | tool_dataprivacy\form\purpose::add_field | ( | \stdClass | $data | ) |  |  | protected | 
 
Add a fieldset to the current form. 
- Parameters
- 
  
  
 
 
◆ convert_existing_data_to_values()
  
  | 
        
          | tool_dataprivacy\form\purpose::convert_existing_data_to_values | ( | \stdClass | $data | ) |  |  | protected | 
 
Normalise any values stored in existing data. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ convert_fields()
  
  | 
        
          | static tool_dataprivacy\form\purpose::convert_fields | ( | \stdClass | $data | ) |  |  | staticprotected | 
 
Converts data to data suitable for storage. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ extra_validation()
  
  | 
        
          | tool_dataprivacy\form\purpose::extra_validation | ( |  | $data, |  
          |  |  |  | $files, |  
          |  |  | array & | $errors ) |  | protected | 
 
Define extra validation mechanims. 
- Parameters
- 
  
    | stdClass | $data | Data to validate. |  | array | $files | Array of files. |  | array | $errors | Currently reported errors. |  
 
- Return values
- 
  
    | array | of additional errors, or overridden errors. |  
 
 
 
◆ filter_data_for_persistent()
      
        
          | tool_dataprivacy\form\purpose::filter_data_for_persistent | ( |  | $data | ) |  | 
      
 
Converts fields. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
◆ get_default_data()
  
  | 
        
          | tool_dataprivacy\form\purpose::get_default_data | ( |  | ) |  |  | protected | 
 
Get the default data. 
- Return values
- 
  
  
 
 
◆ get_lawful_base_field()
  
  | 
        
          | tool_dataprivacy\form\purpose::get_lawful_base_field | ( | string | $prefix = '' | ) |  |  | protected | 
 
Get the mform field for lawful bases. 
- Parameters
- 
  
    | string | $prefix | The prefix to apply to the field |  
 
- Return values
- 
  
  
 
 
◆ get_protected_field()
  
  | 
        
          | tool_dataprivacy\form\purpose::get_protected_field | ( | string | $prefix = '' | ) |  |  | protected | 
 
Get the mform field for the protected flag. 
- Parameters
- 
  
    | string | $prefix | The prefix to apply to the field |  
 
- Return values
- 
  
  
 
 
◆ get_retention_period_fields()
  
  | 
        
          | tool_dataprivacy\form\purpose::get_retention_period_fields | ( | string | $prefix = '' | ) |  |  | protected | 
 
Get the retention period fields. 
- Parameters
- 
  
    | string | $prefix | The name of the main field, and prefix for the subfields. |  
 
- Return values
- 
  
  
 
 
◆ get_role_field()
  
  | 
        
          | tool_dataprivacy\form\purpose::get_role_field | ( | string | $prefix = '' | ) |  |  | protected | 
 
Get the field for the role name. 
- Parameters
- 
  
    | string | $prefix | The prefix to apply to the field |  
 
- Return values
- 
  
  
 
 
◆ get_role_override_id()
  
  | 
        
          | tool_dataprivacy\form\purpose::get_role_override_id | ( | string | $prefix = '' | ) |  |  | protected | 
 
Get the field for the role name. 
- Parameters
- 
  
    | string | $prefix | The prefix to apply to the field |  
 
- Return values
- 
  
  
 
 
◆ get_role_overrides_from_data()
      
        
          | tool_dataprivacy\form\purpose::get_role_overrides_from_data | ( | \stdClass | $data | ) |  | 
      
 
Fetch the role override data from the list of submitted data. 
- Parameters
- 
  
    | stdClass | $data | The complete set of processed data |  
 
- Return values
- 
  
    | stdClass[] | The list of overrides |  
 
 
 
◆ get_sensitive_base_field()
  
  | 
        
          | tool_dataprivacy\form\purpose::get_sensitive_base_field | ( | string | $prefix = '' | ) |  |  | protected | 
 
Get the mform field for sensitive bases. 
- Parameters
- 
  
    | string | $prefix | The prefix to apply to the field |  
 
- Return values
- 
  
  
 
 
◆ set_data()
      
        
          | tool_dataprivacy\form\purpose::set_data | ( |  | $data | ) |  | 
      
 
Load in existing data as form defaults. 
Usually new entry defaults are stored directly in form definition (new entry form); this function is used to load in data where values already exist and data is being edited (edit entry form).
- Parameters
- 
  
  
 
 
The documentation for this class was generated from the following file: