Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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