CRM_Core_Error::fatal("Find criteria missing to generate from. Make sure entity_id and table is set.");
}
+ $count = 0;
foreach ($this->recursionDates as $key => $dateCols) {
$newCriteria = $dateCols;
foreach ($this->overwriteColumns as $col => $val) {
if ($obj->id) {
$newCriteria = array();
+ $newEntities[$this->entity_table][$count] = $obj->id;
+
foreach ($this->linkedEntities as $linkedInfo) {
foreach ($linkedInfo['linkedColumns'] as $col) {
$newCriteria[$col] = $obj->id;
$newCriteria,
CRM_Utils_Array::value('isRecurringEntityRecord', $linkedInfo, TRUE)
);
+
+ if ($linkedObj->id) {
+ $newEntities[$linkedInfo['table']][$count] = $linkedObj->id;
+ }
}
}
- $newEntities[] = $obj->id;
+ $count++;
}
}
'used_for' => 'event'
);
+ $recursion->linkedEntities = array(
+ array(
+ 'table' => 'civicrm_price_set_entity',
+ 'findCriteria' => array(
+ 'entity_id' => $recursion->entity_id,
+ 'entity_table' => 'civicrm_event'
+ ),
+ 'linkedColumns' => array('entity_id'),
+ 'isRecurringEntityRecord' => FALSE,
+ ),
+ array(
+ 'table' => 'civicrm_uf_join',
+ 'findCriteria' => array(
+ 'entity_id' => $recursion->entity_id,
+ 'entity_table' => 'civicrm_event'
+ ),
+ 'linkedColumns' => array('entity_id'),
+ 'isRecurringEntityRecord' => FALSE,
+ ),
+ array(
+ 'table' => 'civicrm_tell_friend',
+ 'findCriteria' => array(
+ 'entity_id' => $recursion->entity_id,
+ 'entity_table' => 'civicrm_event'
+ ),
+ 'linkedColumns' => array('entity_id'),
+ 'isRecurringEntityRecord' => TRUE,
+ ),
+ array(
+ 'table' => 'civicrm_pcp_block',
+ 'findCriteria' => array(
+ 'entity_id' => $recursion->entity_id,
+ 'entity_table' => 'civicrm_event'
+ ),
+ 'linkedColumns' => array('entity_id'),
+ 'isRecurringEntityRecord' => TRUE,
+ ),
+ );
+
$generatedEntities = $recursion->generate();
// set mode to ALL, i.e any change to changing event affects all related recurring activities