36 parent::initializeAttributes();
38 $this->attributes[
'id'] = null;
39 $this->attributes[
'owner_guid'] = null;
40 $this->attributes[
'name'] = null;
41 $this->attributes[
'subtype'] = null;
53 if (in_array(
$name, [
'id',
'owner_guid',
'subtype'])) {
66 if (array_key_exists(
$name, $this->attributes)) {
67 return $this->attributes[
$name];
92 'access_collection' => $this,
126 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.
if(!$item instanceof ElggRiverItem) $object
if(!$user||!$user->canDelete()) $name
$params
Saves global plugin settings.
canEdit($user_guid=null)
Check if user can this collection.
toObject(array $params=[])
{}
getDisplayName()
Get readable access level name for this collection.
__set($name, $value)
Set an attribute.
$user_guid
Validate a user.
$id
River item delete action.
initializeAttributes()
Initialize the attributes array.
__construct(stdClass $row=null)
Create an access collection object.
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.
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 new member to access collection.