Events
in package
The API kernel dispatches a series of events while processing each API request.
For a successful API request, the sequence is RESOLVE => AUTHORIZE => PREPARE => RESPOND. If an exception arises in any stage, then the sequence is aborted and the EXCEPTION event is dispatched.
Event subscribers which are concerned about the order of execution should assign a priority to their subscription (such as W_EARLY, W_MIDDLE, or W_LATE).
Table of Contents
Constants
- AUTHORIZE = 'civi.api.authorize'
- EXCEPTION = 'civi.api.exception'
- Handle any exceptions.
- PREPARE = 'civi.api.prepare'
- RESOLVE = 'civi.api.resolve'
- RESPOND = 'civi.api.respond'
- Apply post-execution logic
- W_EARLY = 100
- Priority - Higher numbers execute earlier
- W_LATE = -100
- Priority - Lower numbers execute later
- W_MIDDLE = 0
- Priority - Middle
Methods
- allEvents() : array<string|int, string>
- hookEventDefs() : mixed
Constants
AUTHORIZE
- You may simply use the event name directly. dev/core#1744
public
mixed
AUTHORIZE
= 'civi.api.authorize'
Tags
EXCEPTION
Handle any exceptions.
- You may simply use the event name directly. dev/core#1744
public
mixed
EXCEPTION
= 'civi.api.exception'
Tags
PREPARE
- You may simply use the event name directly. dev/core#1744
public
mixed
PREPARE
= 'civi.api.prepare'
Tags
RESOLVE
- You may simply use the event name directly. dev/core#1744
public
mixed
RESOLVE
= 'civi.api.resolve'
Tags
RESPOND
Apply post-execution logic
- You may simply use the event name directly. dev/core#1744
public
mixed
RESPOND
= 'civi.api.respond'
Tags
W_EARLY
Priority - Higher numbers execute earlier
public
mixed
W_EARLY
= 100
W_LATE
Priority - Lower numbers execute later
public
mixed
W_LATE
= -100
W_MIDDLE
Priority - Middle
public
mixed
W_MIDDLE
= 0
Methods
allEvents()
public
static allEvents() : array<string|int, string>
Return values
array<string|int, string>hookEventDefs()
public
static hookEventDefs(GenericHookEvent $e) : mixed
Parameters
- $e : GenericHookEvent