25 parent::initializeAttributes();
27 $this->attributes[
'type'] =
'group';
28 $this->attributes[
'subtype'] =
'group';
44 $options[
'inverse_relationship'] =
true;
66 $mode = $this->content_access_mode;
70 $mode = self::CONTENT_ACCESS_MODE_UNRESTRICTED;
72 $mode = self::CONTENT_ACCESS_MODE_MEMBERS_ONLY;
77 if (
$mode === self::CONTENT_ACCESS_MODE_MEMBERS_ONLY) {
81 return self::CONTENT_ACCESS_MODE_UNRESTRICTED;
93 if (!$mode && $this->content_access_mode) {
98 if ($mode !== self::CONTENT_ACCESS_MODE_MEMBERS_ONLY) {
99 $mode = self::CONTENT_ACCESS_MODE_UNRESTRICTED;
102 $this->content_access_mode =
$mode;
113 if (
$user === null) {
121 return $user->hasRelationship($this->guid,
'member');
133 if (!$user->addRelationship($this->guid,
'member')) {
160 return $user->removeRelationship($this->guid,
'member');
167 $object = parent::prepareObject($object);
170 unset($object->read_access);
188 if (!$tool instanceof
Tool) {
192 $md_name = $tool->mapMetadataName();
193 $setting = $this->$md_name;
195 if (!isset($setting)) {
196 return $tool->isEnabledByDefault();
199 return $setting ==
'yes';
212 if (!$tool instanceof
Tool) {
216 $md_name = $tool->mapMetadataName();
217 $md_value = $tool->mapMetadataValue(
'yes');
219 $this->$md_name = $md_value;
234 if (!$tool instanceof
Tool) {
238 $md_name = $tool->mapMetadataName();
239 $md_value = $tool->mapMetadataValue(
'no');
241 $this->$md_name = $md_value;
$params
Saves global plugin settings.
$mode
Configure site maintenance mode.
if(!$user||!$user->canDelete()) $name
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
getGUID()
Returns the guid.
join(\ElggUser $user, array $params=[])
Join a user to this group.
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options
getContentAccessMode()
Return the content access mode.
elgg_get_entities(array $options=[])
Fetches/counts entities or performs a calculation on their properties.
const CONTENT_ACCESS_MODE_UNRESTRICTED
isToolEnabled(string $name)
Checks if a tool option is enabled.
prepareObject(\Elgg\Export\Entity $object)
{}
getMembers(array $options=[])
Get an array of group members.
const CONTENT_ACCESS_MODE_MEMBERS_ONLY
isPublicMembership()
Returns whether the current group has open membership or not.
enableTool(string $name)
Enables a tool option.
disableTool(string $name)
Disables a tool option.
if($email instanceof\Elgg\Email) $object
leave(\ElggUser $user)
Remove a user from the group.
setContentAccessMode(string $mode)
Set the content access mode.
isMember(\ElggUser $user=null)
Is the given user a member of this group?
getTool(string $name)
Returns the registered tool configuration.
_elgg_services()
Get the global service provider.
canAccessContent(ElggUser $user=null)
Check if current user can access group content based on his/her membership status and group's content...
getDisplayName()
Get the entity's display name.