Using standard subplugin support, this commits implements
the restore of logstore subplugins in general and the
standard logstore is particular. Notes:
- TODO: Decide about these 2 pending issues:
1) Some logs are already created (events fired) by the restore process itself. Every time
an API is used and it fires events... corresponding (and actual!)
logs are created. We need to prevent restore to duplicate them (or,
alternatively, stop firing events when restore is happening).
2) There are 2 pieces of information in the logs that, right now, can
not be restored, because the process does not know enough to be able
to remap that information to its new counterparts. We are talking
about objectid and other columns. So we need to specify, in some way
understandable by restore, to which existing mappings they correspond
to.
Before this patch course completion only was restored if, appart from
other conditions... we were restoring to new course, never to existing
one.
This relaxes a bit that condition in order to be able to restore to an
existing course not having any course completion setting defined, so no
conflict will happen ever.
Implements backup and restore for the new conditional availability
data. This includes:
* Backup and restore of new field.
* Restore updates IDs in conditions, as required.
* Restore converts availability data from legacy (Moodle 2.6) backups.
* Unit tests for all this.