25 parent::initializeAttributes();
26 $this->attributes[
'subtype'] =
'group';
49 $options[
'inverse_relationship'] =
true;
71 $mode = $this->content_access_mode;
75 $mode = self::CONTENT_ACCESS_MODE_UNRESTRICTED;
77 $mode = self::CONTENT_ACCESS_MODE_MEMBERS_ONLY;
82 if (
$mode === self::CONTENT_ACCESS_MODE_MEMBERS_ONLY) {
86 return self::CONTENT_ACCESS_MODE_UNRESTRICTED;
98 if (!$mode && $this->content_access_mode) {
103 if ($mode !== self::CONTENT_ACCESS_MODE_MEMBERS_ONLY) {
104 $mode = self::CONTENT_ACCESS_MODE_UNRESTRICTED;
107 $this->content_access_mode =
$mode;
118 if (
$user === null) {
126 return $user->hasRelationship($this->guid,
'member');
172 $object = parent::prepareObject($object);
175 unset($object->read_access);
193 if (!$tool instanceof
Tool) {
197 $md_name = $tool->mapMetadataName();
198 $setting = $this->$md_name;
200 if (!isset($setting)) {
201 return $tool->isEnabledByDefault();
204 return $setting ==
'yes';
217 if (!$tool instanceof
Tool) {
221 $md_name = $tool->mapMetadataName();
222 $md_value = $tool->mapMetadataValue(
'yes');
224 $this->$md_name = $md_value;
239 if (!$tool instanceof
Tool) {
243 $md_name = $tool->mapMetadataName();
244 $md_value = $tool->mapMetadataValue(
'no');
246 $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.
addRelationship(int $guid_two, string $relationship)
Add a relationship between this and another entity.
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.
removeRelationship(int $guid_two, string $relationship)
Remove a relationship.
_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.