Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Events API

From MoodleDocs
Revision as of 06:42, 20 May 2013 by Marina Glancy (talk | contribs) (Created page with "Events and Event-based Logging. Specification for 2.6 = event_base class = <pre> abstract class event_base { // ... constants and all properties as protected variables prot...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Events and Event-based Logging. Specification for 2.6

event_base class

abstract class event_base {
  // ... constants and all properties as protected variables
  protected final function __construct() {}
  protected function __construct($args);
  public static final function create($args) {
    return new self($args);
  }
  public static final funciton restore($object) {
    $event = new self();
    // .. restore each property from $object to $event
  }
  public static final function create_and_trigger($args) {
    $event = self::create($args);
    $event->trigger();
  }
  public final function trigger() {
    // ... 
  }
  public static function event_name();
  public static function event_description();
  public function can_view($user = null);
  public function event_data();
}