34 parent::initializeAttributes();
36 $this->attributes[
'id'] = null;
37 $this->attributes[
'owner_guid'] = null;
38 $this->attributes[
'name'] = null;
39 $this->attributes[
'subtype'] = null;
52 if (in_array(
$name, [
'id',
'owner_guid',
'subtype'])) {
65 if (array_key_exists(
$name, $this->attributes)) {
66 return $this->attributes[
$name];
91 'access_collection' => $this,
114 public function save() : bool {
118 return (
bool)
_elgg_services()->accessCollections->create($this->
name, $this->owner_guid);
125 public function delete() {
157 return _elgg_services()->accessCollections->hasUser($member_guid, $this->
id);
167 return _elgg_services()->accessCollections->addUser($member_guid, $this->
id);
177 return _elgg_services()->accessCollections->removeUser($member_guid, $this->
id);
186 'access_collection' => $this,
196 $object = new \Elgg\Export\AccessCollection();
203 $params[
'access_collection'] = $this;
226 return 'access_collection';
233 if (isset($this->subtype)) {
removeMember($member_guid=0)
Removes a user from access collection.
$params
Saves global plugin settings.
canEdit($user_guid=null)
Check if user can edit this collection.
if(!$user||!$user->canDelete()) $name
toObject(array $params=[])
{}
getDisplayName()
Get readable access level name for this collection.
__set($name, $value)
Set an attribute.
initializeAttributes()
Initialize the attributes array.
__construct(stdClass $row=null)
Create an access collection object.
A generic class that contains shared code among , , and .
getMembers(array $options=[])
Returns members of the access collection.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
__get($name)
Get an attribute.
getOwnerEntity()
Returns owner entity of the collection.
if($email instanceof\Elgg\Email) $object
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
hasMember($member_guid=0)
Checks if user is already in access collection.
_elgg_services()
Get the global service provider.
addMember($member_guid=0)
Adds a user to access collection.
$id
Generic annotation delete action.