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


PHP CRM_ACL_BAO_Cache::build方法代码示例

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


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

示例1: group

 public static function group($type, $contactID = NULL, $tableName = 'civicrm_saved_search', $allGroups = NULL, $includedGroups = NULL)
 {
     $acls = CRM_ACL_BAO_Cache::build($contactID);
     if (!empty($includedGroups) && is_array($includedGroups)) {
         $ids = $includedGroups;
     } else {
         $ids = array();
     }
     if (!empty($acls)) {
         $aclKeys = array_keys($acls);
         $aclKeys = implode(',', $aclKeys);
         $query = "\nSELECT   a.operation, a.object_id\n  FROM   civicrm_acl_cache c, civicrm_acl a\n WHERE   c.acl_id       =  a.id\n   AND   a.is_active    =  1\n   AND   a.object_table = %1\n   AND   a.id        IN ( {$aclKeys} )\nORDER BY a.object_id\n";
         $params = array(1 => array($tableName, 'String'));
         $dao = CRM_Core_DAO::executeQuery($query, $params);
         while ($dao->fetch()) {
             if ($dao->object_id) {
                 if (self::matchType($type, $dao->operation)) {
                     $ids[] = $dao->object_id;
                 }
             } else {
                 // this user has got the permission for all objects of this type
                 // check if the type matches
                 if (self::matchType($type, $dao->operation)) {
                     foreach ($allGroups as $id => $dontCare) {
                         $ids[] = $id;
                     }
                 }
                 break;
             }
         }
     }
     CRM_Utils_Hook::aclGroup($type, $contactID, $tableName, $allGroups, $ids);
     return $ids;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:34,代码来源:ACL.php


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