guid : 0; $container_guid = (int) $container_guid; $cache_key = "$container_guid|$user_guid"; if (empty($cache[$cache_key])) { // compute $container = get_entity($container_guid); $is_visible = (bool) $container; if (!$is_visible) { // see if it *really* exists... $prev_access = elgg_set_ignore_access(); $container = get_entity($container_guid); elgg_set_ignore_access($prev_access); } if ($container && $container instanceof ElggGroup) { /* @var ElggGroup $container */ if ($is_visible) { if (!$container->isPublicMembership()) { if ($user) { if (!$container->isMember($user) && !$user->isAdmin()) { $ret->shouldHideItems = true; $ret->reasonHidden = self::REASON_MEMBERSHIP; } } else { $ret->shouldHideItems = true; $ret->reasonHidden = self::REASON_LOGGEDOUT; } } } else { $ret->shouldHideItems = true; $ret->reasonHidden = self::REASON_NOACCESS; } } $cache[$cache_key] = $ret; } return $cache[$cache_key]; } }