15 const REASON_NON_MEMBER =
'non_member';
16 const REASON_LOGGED_OUT =
'logged_out';
17 const REASON_NO_ACCESS =
'no_access';
22 public $shouldHideItems =
false;
27 public $reasonHidden =
'';
43 static $cache = array();
46 return new \Elgg\GroupItemVisibility();
54 $cache_key =
"$container_guid|$user_guid";
55 if (empty($cache[$cache_key]) || !$use_cache) {
68 $ret = new \Elgg\GroupItemVisibility();
77 $ret->shouldHideItems =
true;
78 $ret->reasonHidden = self::REASON_NON_MEMBER;
81 $ret->shouldHideItems =
true;
82 $ret->reasonHidden = self::REASON_LOGGED_OUT;
86 $ret->shouldHideItems =
true;
87 $ret->reasonHidden = self::REASON_NO_ACCESS;
90 $cache[$cache_key] = $ret;
96 if (count($cache) > 500) {
98 unset($cache[key($cache)]);
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
const CONTENT_ACCESS_MODE_MEMBERS_ONLY
static factory($container_guid, $use_cache=true)
Determine visibility of items within a container for the current user.
$user_guid
Avatar remove action.
get_entity($guid)
Loads and returns an entity object from a guid.