Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add file information to the data record the file is associated to
  2. Add the files to the export→files[] array

Data format for files

Files added to the data records need to have the following format:

...

Code Block
themeEmacs
$record = [
	...
	'files' => [
		'attachments' => [
			[ ... ],
			[ ... ],
			...
		],
		'posts' => [
			[ ... ],
			[ ... ],
			...
		]
	]
];

Helper method

There's a helper method in the export class \totara_userdata\userdata\export::add_file() which adds a file to the export→files[] array and returns the standardised data to be added to the data.

...