Skip to content

Commit

Permalink
Merge pull request #9943 from totten/master-20224
Browse files Browse the repository at this point in the history
CRM-20224 - Cleanup internal event names
  • Loading branch information
eileenmcnaughton authored Mar 7, 2017
2 parents 421606a + fa6fce2 commit 195aacf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions CRM/Core/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,15 @@ public function save($hook = TRUE) {

if ($hook) {
$event = new \Civi\Core\DAO\Event\PostUpdate($this);
\Civi::service('dispatcher')->dispatch("DAO::post-update", $event);
\Civi::service('dispatcher')->dispatch("civi.dao.postUpdate", $event);
}
}
else {
$this->insert();

if ($hook) {
$event = new \Civi\Core\DAO\Event\PostUpdate($this);
\Civi::service('dispatcher')->dispatch("DAO::post-insert", $event);
\Civi::service('dispatcher')->dispatch("civi.dao.postInsert", $event);
}
}
$this->free();
Expand Down Expand Up @@ -529,7 +529,7 @@ public function delete($useWhere = FALSE) {
$result = parent::delete($useWhere);

$event = new \Civi\Core\DAO\Event\PostDelete($this, $result);
\Civi::service('dispatcher')->dispatch("DAO::post-delete", $event);
\Civi::service('dispatcher')->dispatch("civi.dao.postDelete", $event);
$this->free();

return $result;
Expand Down
10 changes: 5 additions & 5 deletions Civi/API/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Events {
*
* @see AuthorizeEvent
*/
const AUTHORIZE = 'api.authorize';
const AUTHORIZE = 'civi.api.authorize';

/**
* Determine which API provider executes the given request. For successful
Expand All @@ -54,28 +54,28 @@ class Events {
*
* @see ResolveEvent
*/
const RESOLVE = 'api.resolve';
const RESOLVE = 'civi.api.resolve';

/**
* Apply pre-execution logic
*
* @see PrepareEvent
*/
const PREPARE = 'api.prepare';
const PREPARE = 'civi.api.prepare';

/**
* Apply post-execution logic
*
* @see RespondEvent
*/
const RESPOND = 'api.respond';
const RESPOND = 'civi.api.respond';

/**
* Handle any exceptions.
*
* @see ExceptionEvent
*/
const EXCEPTION = 'api.exception';
const EXCEPTION = 'civi.api.exception';

/**
* Weight - Early
Expand Down
2 changes: 1 addition & 1 deletion Civi/API/Subscriber/WrapperAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/**
* This is a wrapper for the legacy "API Wrapper" interface which allows
* wrappers to run through the new kernel. It translates from dispatcher events
* ('api.prepare', 'api.respond') to wrapper calls ('fromApiInput', 'toApiOutput').
* ('civi.api.prepare', 'civi.api.respond') to wrapper calls ('fromApiInput', 'toApiOutput').
*/
class WrapperAdapter implements EventSubscriberInterface {

Expand Down
4 changes: 2 additions & 2 deletions Civi/ActionSchedule/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class Events {
*
* @see EntityListEvent
*/
const MAPPINGS = 'actionSchedule.getMappings';
const MAPPINGS = 'civi.actionSchedule.getMappings';

/**
* Prepare the pre-mailing query. This query loads details about
* the contact/entity so that they're available for mail-merge.
*/
const MAILING_QUERY = 'actionSchedule.prepareMailingQuery';
const MAILING_QUERY = 'civi.actionSchedule.prepareMailingQuery';

}
6 changes: 3 additions & 3 deletions Civi/Core/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ public function createEventDispatcher($container) {
$dispatcher->addListener('hook_civicrm_post::Case', array('\Civi\CCase\Events', 'fireCaseChange'));
$dispatcher->addListener('hook_civicrm_caseChange', array('\Civi\CCase\Events', 'delegateToXmlListeners'));
$dispatcher->addListener('hook_civicrm_caseChange', array('\Civi\CCase\SequenceListener', 'onCaseChange_static'));
$dispatcher->addListener('DAO::post-insert', array('\CRM_Core_BAO_RecurringEntity', 'triggerInsert'));
$dispatcher->addListener('DAO::post-update', array('\CRM_Core_BAO_RecurringEntity', 'triggerUpdate'));
$dispatcher->addListener('DAO::post-delete', array('\CRM_Core_BAO_RecurringEntity', 'triggerDelete'));
$dispatcher->addListener('civi.dao.postInsert', array('\CRM_Core_BAO_RecurringEntity', 'triggerInsert'));
$dispatcher->addListener('civi.dao.postUpdate', array('\CRM_Core_BAO_RecurringEntity', 'triggerUpdate'));
$dispatcher->addListener('civi.dao.postDelete', array('\CRM_Core_BAO_RecurringEntity', 'triggerDelete'));
$dispatcher->addListener('hook_civicrm_unhandled_exception', array(
'CRM_Core_LegacyErrorHandler',
'handleException',
Expand Down

0 comments on commit 195aacf

Please sign in to comment.