本文整理汇总了PHP中CRM_Core_BAO_RecurringEntity::status方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_RecurringEntity::status方法的具体用法?PHP CRM_Core_BAO_RecurringEntity::status怎么用?PHP CRM_Core_BAO_RecurringEntity::status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_RecurringEntity
的用法示例。
在下文中一共展示了CRM_Core_BAO_RecurringEntity::status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateEntities
/**
* Generate new DAOs and along with entries in civicrm_recurring_entity table.
*
* @return array
*/
public function generateEntities()
{
self::setStatus(self::RUNNING);
$newEntities = array();
$findCriteria = array();
if (!empty($this->recursionDates)) {
if ($this->entity_id) {
$findCriteria = array('id' => $this->entity_id);
// save an entry with initiating entity-id & entity-table
if ($this->entity_table && !$this->find(TRUE)) {
$this->parent_id = $this->entity_id;
$this->save();
}
}
if (empty($findCriteria)) {
CRM_Core_Error::fatal("Find criteria missing to generate form. Make sure entity_id and table is set.");
}
$count = 0;
foreach ($this->recursionDates as $key => $dateCols) {
$newCriteria = $dateCols;
foreach ($this->overwriteColumns as $col => $val) {
$newCriteria[$col] = $val;
}
// create main entities
$obj = CRM_Core_BAO_RecurringEntity::copyCreateEntity($this->entity_table, $findCriteria, $newCriteria, $this->isRecurringEntityRecord);
if (is_a($obj, 'CRM_Core_DAO') && $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;
}
// create linked entities
$linkedObj = CRM_Core_BAO_RecurringEntity::copyCreateEntity($linkedInfo['table'], $linkedInfo['findCriteria'], $newCriteria, CRM_Utils_Array::value('isRecurringEntityRecord', $linkedInfo, TRUE));
if (is_a($linkedObj, 'CRM_Core_DAO') && $linkedObj->id) {
$newEntities[$linkedInfo['table']][$count] = $linkedObj->id;
}
}
}
$count++;
}
}
self::$status = NULL;
return $newEntities;
}