ElggGroup Class Reference

Inheritance diagram for ElggGroup:
ElggEntity Friendable ElggData Notable Locatable Importable Loggable Exportable

List of all members.

Public Member Functions

 __construct ($guid=null)
 Construct a new group entity, optionally from a given guid value.
 getDisplayName ()
 {Get the entity's display name.
Returns:
string The title or name of this entity.
}
 setDisplayName ($displayName)
 {Sets the title or name of this entity.
Parameters:
string $displayName The title or name of this entity.
Returns:
void
}
 addObjectToGroup (ElggObject $object)
 Add an ElggObject to this group.
 removeObjectFromGroup ($guid)
 Remove an object from the containing group.
 get ($name)
 Returns an attribute or metadata.
 addFriend ($friend_guid)
 Start friendable compatibility block:
 removeFriend ($friend_guid)
 For compatibility with Friendable.
 isFriend ()
 For compatibility with Friendable.
 isFriendsWith ($user_guid)
 For compatibility with Friendable.
 isFriendOf ($user_guid)
 For compatibility with Friendable.
 getFriends ($subtype="", $limit=10, $offset=0)
 For compatibility with Friendable.
 getFriendsOf ($subtype="", $limit=10, $offset=0)
 For compatibility with Friendable.
 getObjects ($subtype="", $limit=10, $offset=0)
 Get objects contained in this group.
 getFriendsObjects ($subtype="", $limit=10, $offset=0)
 For compatibility with Friendable.
 countObjects ($subtype="")
 For compatibility with Friendable.
 getMembers ($limit=10, $offset=0, $count=false)
 End friendable compatibility block.
 isPublicMembership ()
 Returns whether the current group has open membership or not.
 getContentAccessMode ()
 Return the content access mode used by group_gatekeeper().
 setContentAccessMode ($mode)
 Set the content access mode used by group_gatekeeper().
 isMember ($user=null)
 Is the given user a member of this group?
 join (ElggUser $user)
 Join a user to this group.
 leave (ElggUser $user)
 Remove a user from the group.
 getExportableValues ()
 Return an array of fields which can be exported.
 canComment ($user_guid=0)
 Can a user comment on this group?

Public Attributes

const CONTENT_ACCESS_MODE_UNRESTRICTED = 'unrestricted'
const CONTENT_ACCESS_MODE_MEMBERS_ONLY = 'members_only'

Protected Member Functions

 initializeAttributes ()
 Sets the type to group.
 load ($guid)
 Load the ElggGroup data from the database.
 update ()
 {Update the entity in the database.
Returns:
bool Whether the update was successful.
}
 create ()
 {Create a new entry in the entities table.Saves the base information in the entities table for the entity. Saving the type-specific information is handled in the calling class method.
Warning:
Entities must have an entry in both the entities table and their type table or they will throw an exception when loaded.
Returns:
int The new entity's GUID
Exceptions:
InvalidParameterException If the entity's type has not been set.
IOException If the new row fails to write to the DB.
}
 prepareObject ($object)
 {Prepare an object copy for toObject().
Parameters:
stdClass $object Object representation of the entity
Returns:
stdClass
}

Detailed Description

Definition at line 12 of file ElggGroup.php.


Constructor & Destructor Documentation

ElggGroup::__construct ( guid = null  ) 

Construct a new group entity, optionally from a given guid value.

Parameters:
mixed $guid If an int, load that GUID. If an entity table db row, then will load the rest of the data.
Exceptions:
IOException|InvalidParameterException if there was a problem creating the group.

Definition at line 40 of file ElggGroup.php.


Member Function Documentation

ElggGroup::addFriend ( friend_guid  ) 

Start friendable compatibility block:

public function addFriend($friend_guid); public function removeFriend($friend_guid); public function isFriend(); public function isFriendsWith($user_guid); public function isFriendOf($user_guid); public function getFriends($subtype = "", $limit = 10, $offset = 0); public function getFriendsOf($subtype = "", $limit = 10, $offset = 0); public function getObjects($subtype="", $limit = 10, $offset = 0); public function getFriendsObjects($subtype = "", $limit = 10, $offset = 0); public function countObjects($subtype = ""); For compatibility with Friendable.

Join a group when you friend ElggGroup.

Parameters:
int $friend_guid The GUID of the user joining the group.
Returns:
bool

Implements Friendable.

Definition at line 152 of file ElggGroup.php.

ElggGroup::addObjectToGroup ( ElggObject object  ) 

Add an ElggObject to this group.

Parameters:
ElggObject $object The object.
Returns:
bool

Definition at line 96 of file ElggGroup.php.

ElggGroup::canComment ( user_guid = 0  ) 

Can a user comment on this group?

See also:
ElggEntity::canComment()
Parameters:
int $user_guid User guid (default is logged in user)
Returns:
bool
Since:
1.8.0

Reimplemented from ElggEntity.

Definition at line 516 of file ElggGroup.php.

ElggGroup::countObjects ( subtype = ""  ) 

For compatibility with Friendable.

Parameters:
string $subtype Subtype of entities
Returns:
array|false

Implements Friendable.

Definition at line 283 of file ElggGroup.php.

ElggGroup::create (  )  [protected]

{Create a new entry in the entities table.Saves the base information in the entities table for the entity. Saving the type-specific information is handled in the calling class method.

Warning:
Entities must have an entry in both the entities table and their type table or they will throw an exception when loaded.
Returns:
int The new entity's GUID
Exceptions:
InvalidParameterException If the entity's type has not been set.
IOException If the new row fails to write to the DB.
}

Reimplemented from ElggEntity.

Definition at line 461 of file ElggGroup.php.

ElggGroup::get ( name  ) 

Returns an attribute or metadata.

See also:
ElggEntity::get()
Parameters:
string $name Name
Returns:
mixed

Reimplemented from ElggEntity.

Definition at line 120 of file ElggGroup.php.

ElggGroup::getContentAccessMode (  ) 

Return the content access mode used by group_gatekeeper().

Returns:
string One of CONTENT_ACCESS_MODE_* constants private
Since:
1.9.0

Definition at line 321 of file ElggGroup.php.

ElggGroup::getDisplayName (  ) 

{Get the entity's display name.

Returns:
string The title or name of this entity.
}

Reimplemented from ElggEntity.

Definition at line 78 of file ElggGroup.php.

ElggGroup::getExportableValues (  ) 

Return an array of fields which can be exported.

Returns:
array

Reimplemented from ElggEntity.

Definition at line 500 of file ElggGroup.php.

ElggGroup::getFriends ( subtype = "",
limit = 10,
offset = 0 
)

For compatibility with Friendable.

Parameters:
string $subtype The GUID of a user to check.
int $limit Limit
int $offset Offset
Returns:
bool

Implements Friendable.

Definition at line 225 of file ElggGroup.php.

ElggGroup::getFriendsObjects ( subtype = "",
limit = 10,
offset = 0 
)

For compatibility with Friendable.

Parameters:
string $subtype Entity subtype
int $limit Limit
int $offset Offset
Returns:
array|false

Implements Friendable.

Definition at line 270 of file ElggGroup.php.

ElggGroup::getFriendsOf ( subtype = "",
limit = 10,
offset = 0 
)

For compatibility with Friendable.

Parameters:
string $subtype The GUID of a user to check.
int $limit Limit
int $offset Offset
Returns:
bool

Implements Friendable.

Definition at line 240 of file ElggGroup.php.

ElggGroup::getMembers ( limit = 10,
offset = 0,
count = false 
)

End friendable compatibility block.

Get a list of group members.

Parameters:
int $limit Limit
int $offset Offset
bool $count Count
Returns:
mixed

Definition at line 301 of file ElggGroup.php.

ElggGroup::getObjects ( subtype = "",
limit = 10,
offset = 0 
)

Get objects contained in this group.

Parameters:
string $subtype Entity subtype
int $limit Limit
int $offset Offset
Returns:
array|false

Implements Friendable.

Definition at line 255 of file ElggGroup.php.

ElggGroup::initializeAttributes (  )  [protected]

Sets the type to group.

Returns:
void

Reimplemented from ElggEntity.

Definition at line 23 of file ElggGroup.php.

ElggGroup::isFriend (  ) 

For compatibility with Friendable.

Friending a group adds you as a member

Returns:
bool

Implements Friendable.

Definition at line 182 of file ElggGroup.php.

ElggGroup::isFriendOf ( user_guid  ) 

For compatibility with Friendable.

Parameters:
int $user_guid The GUID of a user to check.
Returns:
bool

Implements Friendable.

Definition at line 209 of file ElggGroup.php.

ElggGroup::isFriendsWith ( user_guid  ) 

For compatibility with Friendable.

Parameters:
int $user_guid The GUID of a user to check.
Returns:
bool

Implements Friendable.

Definition at line 195 of file ElggGroup.php.

ElggGroup::isMember ( user = null  ) 

Is the given user a member of this group?

Parameters:
ElggUser $user The user. Default is logged in user.
Returns:
bool

Definition at line 365 of file ElggGroup.php.

ElggGroup::isPublicMembership (  ) 

Returns whether the current group has open membership or not.

Returns:
bool

Definition at line 310 of file ElggGroup.php.

ElggGroup::join ( ElggUser user  ) 

Join a user to this group.

Parameters:
ElggUser $user User joining the group.
Returns:
bool Whether joining was successful.

Definition at line 388 of file ElggGroup.php.

ElggGroup::leave ( ElggUser user  ) 

Remove a user from the group.

Parameters:
ElggUser $user User to remove from the group.
Returns:
bool Whether the user was removed from the group.

Definition at line 406 of file ElggGroup.php.

ElggGroup::load ( guid  )  [protected]

Load the ElggGroup data from the database.

Parameters:
mixed $guid GUID of an ElggGroup entity or database row from entity table
Returns:
bool

Reimplemented from ElggEntity.

Definition at line 421 of file ElggGroup.php.

ElggGroup::prepareObject ( object  )  [protected]

{Prepare an object copy for toObject().

Parameters:
stdClass $object Object representation of the entity
Returns:
stdClass
}

Reimplemented from ElggEntity.

Definition at line 483 of file ElggGroup.php.

ElggGroup::removeFriend ( friend_guid  ) 

For compatibility with Friendable.

Leave group when you unfriend ElggGroup.

Parameters:
int $friend_guid The GUID of the user leaving.
Returns:
bool

Implements Friendable.

Definition at line 168 of file ElggGroup.php.

ElggGroup::removeObjectFromGroup ( guid  ) 

Remove an object from the containing group.

Parameters:
int $guid The guid of the object.
Returns:
bool

Definition at line 107 of file ElggGroup.php.

ElggGroup::setContentAccessMode ( mode  ) 

Set the content access mode used by group_gatekeeper().

Parameters:
string $mode One of CONTENT_ACCESS_MODE_* constants
Returns:
void private
Since:
1.9.0

Definition at line 349 of file ElggGroup.php.

ElggGroup::setDisplayName ( displayName  ) 

{Sets the title or name of this entity.

Parameters:
string $displayName The title or name of this entity.
Returns:
void
}

Reimplemented from ElggEntity.

Definition at line 85 of file ElggGroup.php.

ElggGroup::update (  )  [protected]

{Update the entity in the database.

Returns:
bool Whether the update was successful.
}

Reimplemented from ElggEntity.

Definition at line 441 of file ElggGroup.php.


Member Data Documentation

Definition at line 16 of file ElggGroup.php.

Definition at line 15 of file ElggGroup.php.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations
Generated on Fri May 24 00:01:50 2013 for Elgg by  doxygen 1.6.3