33 parent::initializeAttributes();
35 $this->attributes[
'id'] = null;
36 $this->attributes[
'owner_guid'] =
_elgg_services()->session_manager->getLoggedInUserGuid();
37 $this->attributes[
'name'] = null;
38 $this->attributes[
'subtype'] = null;
58 if (
strlen($value) > 255) {
59 throw new \Elgg\Exceptions\LengthException(
'The "subtype" of an ElggAccessCollection cannot be greated than 255 characters');
66 throw new \Elgg\Exceptions\LengthException(
'The "name" of an ElggAccessCollection cannot be empty');
70 $value = (int) $value;
72 throw new \Elgg\Exceptions\InvalidArgumentException(
"The 'owner_guid' ({$value}) for the ElggAccessColelction doesn't seem to exists");
88 return $this->attributes[
$name] ?? null;
113 'access_collection' => $this,
147 public function delete():
bool {
181 return _elgg_services()->accessCollections->hasUser($member_guid, $this->
id);
192 return _elgg_services()->accessCollections->addUser($member_guid, $this->
id);
203 return _elgg_services()->accessCollections->removeUser($member_guid, $this->
id);
212 'access_collection' => $this,
222 $object = new \Elgg\Export\AccessCollection();
229 $params[
'access_collection'] = $this;
252 return 'access_collection';
259 if (isset($this->subtype)) {
canEdit(int $user_guid=null)
Check if user can edit this collection.
getObjectFromID(int $id)
{}
addMember(int $member_guid=0)
Adds a user to access collection.
$params
Saves global plugin settings.
if(!$user||!$user->canDelete()) $name
toObject(array $params=[])
{}
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
hasMember(int $member_guid=0)
Checks if user is already in access collection.
getDisplayName()
Get readable access level name for this collection.
__set($name, $value)
Set an attribute.
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options
initializeAttributes()
Initialize the attributes array.
__construct(stdClass $row=null)
Create an access collection object.
$filter
Layout content filter.
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
_elgg_services()
Get the global service provider.
removeMember(int $member_guid=0)
Removes a user from access collection.
elgg_normalize_url(string $url)
$id
Generic annotation delete action.