Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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