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


PHP Members::getSubmembers方法代码示例

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


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

示例1: get_member_childs

 function get_member_childs()
 {
     $mem_id = array_var($_GET, 'member');
     $offset = array_var($_REQUEST, 'offset', 0);
     $limit = array_var($_REQUEST, 'limit', 100);
     $new_limit = $limit + 1;
     if (function_exists('logged_user') && logged_user() instanceof Contact && ContactMemberPermissions::contactCanAccessMemberAll(implode(',', logged_user()->getPermissionGroupIds()), $mem_id, logged_user(), ACCESS_LEVEL_READ)) {
         $mem = Members::getMemberById($mem_id);
         if ($mem instanceof Member) {
             //Do not use contact member cache for superadmins
             if (!logged_user()->isAdministrator()) {
                 //use the contact member cache
                 $dimension = $mem->getDimension();
                 $params = array("dimension" => $dimension, "contact_id" => logged_user()->getId(), "parent_member_id" => $mem->getId(), "extra_condition" => " AND m.archived_by_id=0 ", "start" => $offset, "limit" => $new_limit, "order" => '`name`', "order_dir" => 'ASC');
                 $childs = $member_cache_list = ContactMemberCaches::getAllMembersWithCachedParentId($params);
             } else {
                 $childs = Members::getSubmembers($mem, false, "", null, null, $offset, $new_limit);
             }
             $more_nodes_left = false;
             if (count($childs) > $limit) {
                 $more_nodes_left = true;
                 array_pop($childs);
             }
             // filter $childs by other dimension associations
             $context = active_context();
             $filter_by_members = array();
             foreach ($context as $selection) {
                 if ($selection instanceof Member) {
                     $filter_by_members[] = $selection;
                 }
             }
             // build resultant member list
             $members = $this->buildMemberList($childs, $mem->getDimension(), null, null, null, null);
             ajx_extra_data(array("members" => $members, "dimension" => $mem->getDimensionId(), "member_id" => $mem->getId(), "more_nodes_left" => $more_nodes_left));
         }
     }
     ajx_current("empty");
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:38,代码来源:DimensionController.class.php

示例2: active_context_members

function active_context_members($full = true ) {
	
	$ctxMembers  = array ();
	if (is_array(active_context())) {
		foreach (active_context() as $ctx) {
			if ( $ctx instanceof Member ) {
				/* @var Dimension $ctx */
				$ctxMembers[$ctx->getId()] = $ctx->getId() ;
				if($full){
					foreach ( Members::getSubmembers($ctx, 1) as $sub ) {
						$ctxMembers[$sub->getId()] = $sub->getId() ;		
					}
				}
				
			}
			
			if  ( $full && $ctx instanceof Dimension ) {
				/// @var Dimension $ctx 
				foreach ($ctx->getAllMembers() as $member) {
					$ctxMembers[$member->getId()] = $member->getId() ;
					foreach ( Members::getSubmembers($member, 1) as $sub ) {
						$ctxMembers[$sub->getId()] = $sub->getId() ;
					}
				} 
			}
		}
	}
	return $ctxMembers ;
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:29,代码来源:functions.php


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