projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #23742 from eileenmcnaughton/import_remove
[civicrm-core.git]
/
CRM
/
Core
/
BAO
/
RecurringEntity.php
diff --git
a/CRM/Core/BAO/RecurringEntity.php
b/CRM/Core/BAO/RecurringEntity.php
index fceb1237b154f3e87b3518d2b1ff09c01cc7bf75..8b7da449eed1805ceadd7c5a679b99f906af4b5a 100644
(file)
--- a/
CRM/Core/BAO/RecurringEntity.php
+++ b/
CRM/Core/BAO/RecurringEntity.php
@@
-20,7
+20,7
@@
use When\When;
/**
* Class CRM_Core_BAO_RecurringEntity.
*/
/**
* Class CRM_Core_BAO_RecurringEntity.
*/
-class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
+class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity
implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
{
const RUNNING = 1;
public $schedule = [];
const RUNNING = 1;
public $schedule = [];
@@
-115,6
+115,14
@@
class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
const MODE_NEXT_ALL_ENTITY = 2;
const MODE_ALL_ENTITY_IN_SERIES = 3;
const MODE_NEXT_ALL_ENTITY = 2;
const MODE_ALL_ENTITY_IN_SERIES = 3;
+ public static function getSubscribedEvents() {
+ return [
+ 'civi.dao.postInsert' => 'triggerInsert',
+ 'civi.dao.postUpdate' => 'triggerUpdate',
+ 'civi.dao.postDelete' => 'triggerDelete',
+ ];
+ }
+
/**
* Getter for status.
*
/**
* Getter for status.
*
@@
-580,15
+588,6
@@
class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
* An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just updated.
*/
public static function triggerUpdate($event) {
* An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just updated.
*/
public static function triggerUpdate($event) {
- // if DB version is earlier than 4.6 skip any processing
- static $currentVer = NULL;
- if (!$currentVer) {
- $currentVer = CRM_Core_BAO_Domain::version();
- }
- if (version_compare($currentVer, '4.6.alpha1') < 0) {
- return;
- }
-
static $processedEntities = [];
$obj =& $event->object;
if (empty($obj->id) || empty($obj->__table)) {
static $processedEntities = [];
$obj =& $event->object;
if (empty($obj->id) || empty($obj->__table)) {
@@
-653,15
+652,6
@@
class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
return;
}
return;
}
- // if DB version is earlier than 4.6 skip any processing
- static $currentVer = NULL;
- if (!$currentVer) {
- $currentVer = CRM_Core_BAO_Domain::version();
- }
- if (version_compare($currentVer, '4.6.alpha1') < 0) {
- return;
- }
-
static $processedEntities = [];
if (empty($obj->id) || empty($obj->__table)) {
return;
static $processedEntities = [];
if (empty($obj->id) || empty($obj->__table)) {
return;
@@
-757,15
+747,6
@@
class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
public static function triggerDelete($event) {
$obj =& $event->object;
public static function triggerDelete($event) {
$obj =& $event->object;
- // if DB version is earlier than 4.6 skip any processing
- static $currentVer = NULL;
- if (!$currentVer) {
- $currentVer = CRM_Core_BAO_Domain::version();
- }
- if (version_compare($currentVer, '4.6.alpha1') < 0) {
- return;
- }
-
static $processedEntities = [];
if (empty($obj->id) || empty($obj->__table) || !$event->result) {
return;
static $processedEntities = [];
if (empty($obj->id) || empty($obj->__table) || !$event->result) {
return;
@@
-1130,7
+1111,7
@@
class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
$dao = self::$_tableDAOMapper[$linkedEntityTable];
}
else {
$dao = self::$_tableDAOMapper[$linkedEntityTable];
}
else {
- CRM_Core_Session::setStatus(
'Could not update mode for linked entities'
);
+ CRM_Core_Session::setStatus(
ts('Could not update mode for linked entities')
);
return NULL;
}
$entityTable = $linkedEntityTable;
return NULL;
}
$entityTable = $linkedEntityTable;