ElggSite Class Reference

A Site entity. More...

Inheritance diagram for ElggSite:
ElggEntity ElggData Notable Locatable Importable Loggable Exportable

List of all members.

Public Member Functions

 __construct ($guid=null)
 Load or create a new ElggSite.
 save ()
 Saves site-specific attributes.
 delete ()
 Delete the site.
 disable ($reason="", $recursive=true)
 Disable the site.
 getMembers ($options=array(), $offset=0)
 Gets an array of ElggUser entities who are members of the site.
 listMembers ($options=array())
 List the members of this site.
 addUser ($user_guid)
 Adds a user to the site.
 removeUser ($user_guid)
 Removes a user from the site.
 getObjects ($subtype="", $limit=10, $offset=0)
 Returns an array of ElggObject entities that belong to the site.
 addObject ($object_guid)
 Adds an object to the site.
 removeObject ($object_guid)
 Remvoes an object from the site.
 getCollections ($subtype="", $limit=10, $offset=0)
 Get the collections associated with a site.
 getExportableValues ()
 Return an array of fields which can be exported.
 checkWalledGarden ()
 Halts bootup and redirects to the site front page if site is in walled garden mode, no user is logged in, and the URL is not a public page.
 isPublicPage ($url= '')
 Returns if a URL is public for this site when in Walled Garden mode.

Protected Member Functions

 initializeAttributes ()
 Initialise the attributes array.
 load ($guid)
 Loads the full ElggSite when given a guid.

Detailed Description

A Site entity.

ElggSite represents a single site entity.

An ElggSite object is an ElggEntity child class with the subtype of "site." It is created upon installation and hold all the information about a site:

Every ElggEntity (except ElggSite) belongs to a site.

Definition at line 29 of file ElggSite.php.


Constructor & Destructor Documentation

ElggSite::__construct ( guid = null  ) 

Load or create a new ElggSite.

If no arguments are passed, create a new entity.

If an argument is passed attempt to load a full Site entity. Arguments can be:

  • The GUID of a site entity.
  • A URL as stored in ElggSite->url
  • A DB result object with a guid property
Parameters:
mixed $guid If an int, load that GUID. If a db row then will load the rest of the data.
Exceptions:
IOException If passed an incorrect guid
InvalidParameterException If passed an Elgg* Entity that isn't an ElggSite

Definition at line 66 of file ElggSite.php.


Member Function Documentation

ElggSite::addObject ( object_guid  ) 

Adds an object to the site.

Parameters:
int $object_guid GUID
Returns:
bool

Definition at line 301 of file ElggSite.php.

ElggSite::addUser ( user_guid  ) 

Adds a user to the site.

Parameters:
int $user_guid GUID
Returns:
bool

Definition at line 263 of file ElggSite.php.

ElggSite::checkWalledGarden (  ) 

Halts bootup and redirects to the site front page if site is in walled garden mode, no user is logged in, and the URL is not a public page.

void 1.8.0

Definition at line 358 of file ElggSite.php.

ElggSite::delete (  ) 

Delete the site.

Note:
You cannot delete the current site.
Returns:
bool
Exceptions:
SecurityException 

Reimplemented from ElggData.

Definition at line 167 of file ElggSite.php.

ElggSite::disable ( reason = "",
recursive = true 
)

Disable the site.

Note:
You cannot disable the current site.
Parameters:
string $reason Optional reason for disabling
bool $recursive Recursively disable all contained entities?
Returns:
bool
Exceptions:
SecurityException 

Reimplemented from ElggEntity.

Definition at line 187 of file ElggSite.php.

ElggSite::getCollections ( subtype = "",
limit = 10,
offset = 0 
)

Get the collections associated with a site.

Parameters:
string $subtype Subtype
int $limit Limit
int $offset Offset
Returns:
unknown

Definition at line 326 of file ElggSite.php.

ElggSite::getExportableValues (  ) 

Return an array of fields which can be exported.

Returns:
array

Reimplemented from ElggEntity.

Definition at line 340 of file ElggSite.php.

ElggSite::getMembers ( options = array(),
offset = 0 
)

Gets an array of ElggUser entities who are members of the site.

Parameters:
array $options An associative array for key => value parameters accepted by elgg_get_entities(). Common parameters include 'limit', and 'offset'. Note: this was $limit before version 1.8
int $offset Offset
Returns:
array of ElggUsers

Definition at line 210 of file ElggSite.php.

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

Returns an array of ElggObject entities that belong to the site.

Warning:
This only returns objects that have been explicitly added to the site through addObject()
Parameters:
string $subtype Entity subtype
int $limit Limit
int $offset Offset
Returns:
array

Definition at line 290 of file ElggSite.php.

ElggSite::initializeAttributes (  )  [protected]

Initialise the attributes array.

This is vital to distinguish between metadata and base parameters.

Place your base parameters here.

Returns:
void

Reimplemented from ElggEntity.

Definition at line 39 of file ElggSite.php.

ElggSite::isPublicPage ( url = ''  ) 

Returns if a URL is public for this site when in Walled Garden mode.

Pages are registered to be public by { public_pages walled_garden}.

Parameters:
string $url Defaults to the current URL.
Returns:
bool
Since:
1.8.0

Definition at line 400 of file ElggSite.php.

ElggSite::listMembers ( options = array()  ) 

List the members of this site.

Parameters:
array $options An associative array for key => value parameters accepted by elgg_list_entities(). Common parameters include 'full_view', 'limit', and 'offset'.
Returns:
string
Since:
1.8.0

Definition at line 242 of file ElggSite.php.

ElggSite::load ( guid  )  [protected]

Loads the full ElggSite when given a guid.

Parameters:
mixed $guid GUID of ElggSite entity or database row object
Returns:
bool
Exceptions:
InvalidClassException 

Reimplemented from ElggEntity.

Definition at line 115 of file ElggSite.php.

ElggSite::removeObject ( object_guid  ) 

Remvoes an object from the site.

Parameters:
int $object_guid GUID
Returns:
bool

Definition at line 312 of file ElggSite.php.

ElggSite::removeUser ( user_guid  ) 

Removes a user from the site.

Parameters:
int $user_guid GUID
Returns:
bool

Definition at line 274 of file ElggSite.php.

ElggSite::save (  ) 

Saves site-specific attributes.

Reimplemented from ElggEntity.

Definition at line 139 of file ElggSite.php.


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