Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Abstract class describing Inbound Message Handlers.

Copyright: 2014 Andrew Nicols
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 306 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: handler  - X-Ref

Abstract class describing Inbound Message Handlers.

__get($key)   X-Ref
Magic getter to fetch the specified key.

param: string $key The name of the key to retrieve

set_id($id)   X-Ref
Set the id name.

param: int $id The id to set
return: int The newly set id

set_component($component)   X-Ref
Set the component name.

param: string $component The component to set
return: string The newly set component

can_change_validateaddress()   X-Ref
Whether the current handler allows changes to the address validation
setting.

By default this will return true, but for some handlers it may be
necessary to disallow such changes.

return: boolean

set_validateaddress($validateaddress)   X-Ref
Set whether validation of the address is required.

param: bool $validateaddress The new state of validateaddress
return: bool

can_change_defaultexpiration()   X-Ref
Whether the current handler allows changes to expiry of the generated email address.

By default this will return true, but for some handlers it may be
necessary to disallow such changes.

return: boolean

can_change_enabled()   X-Ref
Whether this handler can be disabled (or enabled).

By default this will return true, but for some handlers it may be
necessary to disallow such changes. For example, a core handler to
handle rejected mail validation should not be disabled.

return: boolean

set_enabled($enabled)   X-Ref
Set the enabled name.

param: bool $enabled The new state of enabled
return: bool

set_defaultexpiration($period)   X-Ref
Set the default validity for new keys.

param: int $period The time in seconds before a key expires
return: int

get_classname()   X-Ref
Get the non-namespaced name of the current class.

return: string The classname

get_success_message(\stdClass $messagedata, $handlerresult)   X-Ref
Return the content of any success notification to be sent.
Both an HTML and Plain Text variant must be provided.

If this handler does not need to send a success notification, then
it should return a falsey value.

param: \stdClass $messagedata The message data.
param: \stdClass $handlerresult The record for the newly created post.
return: \stdClass with keys `html` and `plain`.

remove_quoted_text($messagedata)   X-Ref
Remove quoted message string from the text (NOT HTML) message.

param: \stdClass $messagedata The Inbound Message record
return: array message and message format to use.