当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Core_BAO_PrevNextCache::markSelection方法代码示例

本文整理汇总了PHP中CRM_Core_BAO_PrevNextCache::markSelection方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_PrevNextCache::markSelection方法的具体用法?PHP CRM_Core_BAO_PrevNextCache::markSelection怎么用?PHP CRM_Core_BAO_PrevNextCache::markSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_BAO_PrevNextCache的用法示例。


在下文中一共展示了CRM_Core_BAO_PrevNextCache::markSelection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: selectUnselectRelationships

 /**
  * Used to store selected contacts across multiple pages in advanced search.
  */
 public static function selectUnselectRelationships()
 {
     $name = CRM_Utils_Array::value('name', $_REQUEST);
     $cacheKey = CRM_Utils_Array::value('qfKey', $_REQUEST);
     $state = CRM_Utils_Array::value('state', $_REQUEST, 'checked');
     $variableType = CRM_Utils_Array::value('variableType', $_REQUEST, 'single');
     $actionToPerform = CRM_Utils_Array::value('action', $_REQUEST, 'select');
     if ($variableType == 'multiple') {
         // action post value only works with multiple type variable
         if ($name) {
             //multiple names like mark_x_1-mark_x_2 where 1,2 are cids
             $elements = explode('-', $name);
             foreach ($elements as $key => $element) {
                 $elements[$key] = self::_convertToId($element);
             }
             CRM_Core_BAO_PrevNextCache::markSelection($cacheKey, $actionToPerform, $elements, 'civicrm_relationship');
         } else {
             CRM_Core_BAO_PrevNextCache::markSelection($cacheKey, $actionToPerform, NULL, 'civicrm_relationship');
         }
     } elseif ($variableType == 'single') {
         $cId = self::_convertToId($name);
         $action = $state == 'checked' ? 'select' : 'unselect';
         CRM_Core_BAO_PrevNextCache::markSelection($cacheKey, $action, $cId, 'civicrm_relationship');
     }
     $contactIds = CRM_Core_BAO_PrevNextCache::getSelection($cacheKey, 'get', 'civicrm_relationship');
     $countSelectionCids = count($contactIds[$cacheKey]);
     $arrRet = array('getCount' => $countSelectionCids);
     CRM_Utils_JSON::output($arrRet);
 }
开发者ID:Chirojeugd-Vlaanderen,项目名称:civicrm-relationship-entity,代码行数:32,代码来源:AJAX.php

示例2: selectUnselectContacts

 static function selectUnselectContacts()
 {
     $name = CRM_Utils_Array::value('name', $_POST);
     $cacheKey = CRM_Utils_Array::value('qfKey', $_POST);
     $state = CRM_Utils_Array::value('state', $_POST, 'checked');
     $variableType = CRM_Utils_Array::value('variableType', $_POST, 'single');
     $actionToPerform = CRM_Utils_Array::value('action', $_POST, 'select');
     if ($actionToPerform == 'countSelection') {
         $contactIds = CRM_Core_BAO_PrevNextCache::getSelection($cacheKey);
         $countSelectionCids = count($contactIds[$cacheKey]);
         $arrRet = array('getCount' => $countSelectionCids);
         echo json_encode($arrRet);
         CRM_Utils_System::civiExit();
     } elseif ($variableType == 'multiple') {
         // action post value only works with multiple type variable
         if ($name) {
             //multiple names like mark_x_1-mark_x_2 where 1,2 are cids
             $elements = explode('-', $name);
             foreach ($elements as $key => $element) {
                 $elements[$key] = self::_convertToId($element);
             }
             CRM_Core_BAO_PrevNextCache::markSelection($cacheKey, $actionToPerform, $elements);
         } else {
             CRM_Core_BAO_PrevNextCache::markSelection($cacheKey, $actionToPerform);
         }
     } elseif ($variableType == 'single') {
         $cId = self::_convertToId($name);
         $action = $state == 'checked' ? 'select' : 'unselect';
         CRM_Core_BAO_PrevNextCache::markSelection($cacheKey, $action, $cId);
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:31,代码来源:AJAX.php


注:本文中的CRM_Core_BAO_PrevNextCache::markSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。