3cd4626c7428f7f7bdf68142f44b3eac384eff4c
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
30 * The API kernel dispatches a series of events while processing each API request.
31 * For a successful API request, the sequence is RESOLVE => AUTHORIZE => PREPARE => RESPOND.
32 * If an exception arises in any stage, then the sequence is aborted and the EXCEPTION
33 * event is dispatched.
35 * Event subscribers which are concerned about the order of execution should assign
36 * a weight to their subscription (such as W_EARLY, W_MIDDLE, or W_LATE).
42 * Determine whether the API request is allowed for the current user.
43 * For successful execution, at least one listener must invoke
44 * $event->authorize().
48 const AUTHORIZE
= 'api.authorize';
51 * Determine which API provider executes the given request. For successful
52 * execution, at least one listener must invoke
53 * $event->setProvider($provider).
57 const RESOLVE
= 'api.resolve';
60 * Apply pre-execution logic
64 const PREPARE
= 'api.prepare';
67 * Apply post-execution logic
71 const RESPOND
= 'api.respond';
74 * Handle any exceptions.
78 const EXCEPTION
= 'api.exception';
96 * @return array<string>
98 public static function allEvents() {