Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Class represents a single subscription.

Copyright: 2014 onwards Ankit Agarwal <ankit.agrr@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 198 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

subscription:: (11 methods):
  __construct()
  __get()
  __isset()
  get_instance_name()
  get_event_name()
  get_filters_description()
  get_name()
  get_description()
  get_plugin_name()
  get_course_name()
  can_manage_rule()


Class: subscription  - X-Ref

Class represents a single subscription instance (i.e with all the subscription info).

__construct($subscription)   X-Ref
Constructor.

use {@link \tool_monitor\subscription_manager::get_subscription} to get an instance instead of directly calling this method.

param: \stdClass $subscription

__get($prop)   X-Ref
Magic get method.

param: string $prop property to get.
return: mixed

__isset($prop)   X-Ref
Magic isset method.

param: string $prop the property to get.
return: bool true if the property is set, false otherwise.

get_instance_name()   X-Ref
Get a human readable name for instances associated with this subscription.

return: string

get_event_name()   X-Ref
Method to get event name.

return: string

get_filters_description()   X-Ref
Get filter description.

return: string

get_name(\context $context)   X-Ref
Get properly formatted name of the rule associated.

param: \context $context context where this name would be displayed.
return: string Formatted name of the rule.

get_description(\context $context)   X-Ref
Get properly formatted description of the rule associated.

param: \context $context context where this description would be displayed.
return: string Formatted description of the rule.

get_plugin_name()   X-Ref
Get name of the plugin associated with this rule

return: string Plugin name.

get_course_name(\context $context)   X-Ref
Get properly formatted name of the course associated.

param: \context $context context where this name would be displayed.
return: string Formatted name of the rule.

can_manage_rule()   X-Ref
Can the current user manage the rule associate with this subscription?

return: bool true if the current user can manage this rule, else false.