<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
namespace Civi\CCase;
+/**
+ * Class Events
+ *
+ * @package Civi\CCase
+ */
class Events {
/**
* @var array (int $caseId => bool $active) list of cases for which we are actively firing case-change event
$caseId = $event->object->case_id;
}
break;
+
case 'Case':
// by the time we get the post-delete event, the record is gone, so
// there's nothing to analyze
$caseId = $event->id;
}
break;
+
default:
throw new \CRM_Core_Exception("CRM_Case_Listener does not support entity {$event->entity}");
}
if ($caseId) {
if (!isset(self::$isActive[$caseId])) {
+ $tx = new \CRM_Core_Transaction();
\CRM_Core_Transaction::addCallback(
\CRM_Core_Transaction::PHASE_POST_COMMIT,
array(__CLASS__, 'fireCaseChangeForRealz'),
}
}
+ /**
+ * @param $caseId
+ */
public static function fireCaseChangeForRealz($caseId) {
if (!isset(self::$isActive[$caseId])) {
$tx = new \CRM_Core_Transaction();
}
/**
- * Find any extra listeners declared in XML and pass the event along to them
+ * Find any extra listeners declared in XML and pass the event along to them.
*
- * @param Event\CaseChangeEvent $event
+ * @param \Civi\CCase\Event\CaseChangeEvent $event
*/
public static function delegateToXmlListeners(\Civi\CCase\Event\CaseChangeEvent $event) {
$p = new \CRM_Case_XMLProcessor_Process();
$listener->onCaseChange($event);
}
}
+
}