Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Adhoc task handling migrating data to the new messaging table schema.

Copyright: 2018 Mark Nelson <markn@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 290 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

migrate_message_data:: (5 methods):
  execute()
  migrate_data()
  migrate_notification()
  migrate_message()
  queue_task()


Class: migrate_message_data  - X-Ref

Class handling migrating data to the new messaging table schema.

execute()   X-Ref
Run the migration task.


migrate_data($userid, $otheruserid)   X-Ref
Helper function to deal with migrating the data.

param: int $userid The current user id.
param: int $otheruserid The user id of the other user in the conversation.

migrate_notification($notification, $isread)   X-Ref
Helper function to deal with migrating an individual notification.

param: \stdClass $notification
param: bool $isread Was the notification read?

migrate_message($conversationid, $message)   X-Ref
Helper function to deal with migrating an individual message.

param: int $conversationid The conversation between the two users.
param: \stdClass $message The message from either the 'message' or 'message_read' table

queue_task($userid)   X-Ref
Queues the task.

param: int $userid