本文整理汇总了PHP中CRM_Core_BAO_PrevNextCache::flipPair方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_PrevNextCache::flipPair方法的具体用法?PHP CRM_Core_BAO_PrevNextCache::flipPair怎么用?PHP CRM_Core_BAO_PrevNextCache::flipPair使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_PrevNextCache
的用法示例。
在下文中一共展示了CRM_Core_BAO_PrevNextCache::flipPair方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFlipData
public function testFlipData()
{
$dao = new CRM_Core_BAO_PrevNextCache();
$dao->entity_id1 = 1;
$dao->entity_id2 = 2;
$dao->data = serialize(array('srcID' => 1, 'srcName' => 'Ms. Meliissa Mouse II', 'dstID' => 2, 'dstName' => 'Mr. Maurice Mouse II', 'weight' => 20, 'canMerge' => TRUE));
$dao->save();
$dao = new CRM_Core_BAO_PrevNextCache();
$dao->id = 1;
CRM_Core_BAO_PrevNextCache::flipPair(array(1), 0);
$dao->find(TRUE);
$this->assertEquals(1, $dao->entity_id1);
$this->assertEquals(2, $dao->entity_id2);
$this->assertEquals(serialize(array('srcName' => 'Mr. Maurice Mouse II', 'dstID' => 1, 'dstName' => 'Ms. Meliissa Mouse II', 'weight' => 20, 'canMerge' => TRUE, 'srcID' => 2)), $dao->data);
$this->quickCleanup(array('civicrm_prevnext_cache'));
}
示例2: flipDupePairs
/**
* Swap contacts in a dupe pair i.e main with duplicate contact.
*
* @param int $prevNextId
*/
public static function flipDupePairs($prevNextId = NULL)
{
if (!$prevNextId) {
// @todo figure out if this is always POST & specify that rather than inexact GET
$prevNextId = CRM_Utils_Request::retrieve('pnid', 'Integer');
}
$onlySelected = FALSE;
if (is_array($prevNextId) && !CRM_Utils_Array::crmIsEmptyArray($prevNextId)) {
$onlySelected = TRUE;
}
$prevNextId = CRM_Utils_Type::escapeAll((array) $prevNextId, 'Positive');
CRM_Core_BAO_PrevNextCache::flipPair($prevNextId, $onlySelected);
CRM_Utils_System::civiExit();
}