*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
require_once 'packages/When/When.php';
/**
- * Class CRM_Core_BAO_RecurringEntity
+ * Class CRM_Core_BAO_RecurringEntity.
*/
class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity {
* This function updates the mode column in the civicrm_recurring_entity table.
*
* @param int $mode
- * Mode of the entity to cascade changes across parent/child relations eg 1 - only this entity, 2 - this and the following entities, 3 - All the entity .
- *
- *
- * @return void
+ * Mode of the entity to cascade changes across parent/child relations eg 1 - only this entity, 2 - this and the following entities, 3 - All the entity.
*/
public function mode($mode) {
if ($this->entity_id && $this->entity_table) {
}
/**
- * This function acts as a listener to dao->update whenever there is an update,
- * and propagates any changes to all related entities present in recurring entity table
+ * This function acts as a listener to dao->update whenever there is an update.
*
- * @param object $event
- * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just updated .
+ * It propagates any changes to all related entities present in recurring entity table
*
- *
- * @return void
+ * @param object $event
+ * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just updated.
*/
static public function triggerUpdate($event) {
// if DB version is earlier than 4.6 skip any processing
static $processedEntities = array();
$obj =& $event->object;
if (empty($obj->id) || empty($obj->__table)) {
- return FALSE;
+ return;
}
$key = "{$obj->__table}_{$obj->id}";
if (array_key_exists($key, $processedEntities)) {
// already processed
- return NULL;
+ return;
}
// get related entities
$repeatingEntities = self::getEntitiesFor($obj->id, $obj->__table, FALSE, NULL);
if (empty($repeatingEntities)) {
// return if its not a recurring entity parent
- return NULL;
+ return;
}
// mark being processed
$processedEntities[$key] = 1;
* and creates entries for linked entities in recurring entity table
*
* @param object $event
- * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just inserted .
- *
- *
- * @return void
+ * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just inserted.
*/
static public function triggerInsert($event) {
$obj =& $event->object;
if (!array_key_exists($obj->__table, self::$_linkedEntitiesInfo)) {
- return FALSE;
+ return;
}
// if DB version is earlier than 4.6 skip any processing
static $processedEntities = array();
if (empty($obj->id) || empty($obj->__table)) {
- return FALSE;
+ return;
}
$key = "{$obj->__table}_{$obj->id}";
if (array_key_exists($key, $processedEntities)) {
// already being processed. Exit recursive calls.
- return NULL;
+ return;
}
if (self::getStatus() == self::RUNNING) {
// if recursion->generate() is doing some work, lets not intercept
- return NULL;
+ return;
}
// mark being processed
foreach ($pRepeatingEntities as $key => $val) {
if (array_key_exists($key, $processedEntities)) {
// this graph is already being processed
- return NULL;
+ return;
}
$processedEntities[$key] = 1;
}
* This function acts as a listener to dao->delete, and deletes an entry from recurring_entity table
*
* @param object $event
- * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just deleted .
- *
- *
- * @return void
+ * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just deleted.
*/
static public function triggerDelete($event) {
$obj =& $event->object;
static $processedEntities = array();
if (empty($obj->id) || empty($obj->__table) || !$event->result) {
- return FALSE;
+ return;
}
$key = "{$obj->__table}_{$obj->id}";
if (array_key_exists($key, $processedEntities)) {
// already processed
- return NULL;
+ return;
}
// mark being processed