A Site entity. More...
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. | |
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.
| 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:
| mixed | $guid If an int, load that GUID. If a db row then will load the rest of the data. |
| 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.
| ElggSite::addObject | ( | $ | object_guid | ) |
Adds an object to the site.
| int | $object_guid GUID |
Definition at line 301 of file ElggSite.php.
| ElggSite::addUser | ( | $ | user_guid | ) |
Adds a user to the site.
| int | $user_guid GUID |
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.
Definition at line 358 of file ElggSite.php.
| ElggSite::delete | ( | ) |
Delete the site.
| SecurityException |
Reimplemented from ElggData.
Definition at line 167 of file ElggSite.php.
| ElggSite::disable | ( | $ | reason = "", |
|
| $ | recursive = true | |||
| ) |
Disable the site.
| string | $reason Optional reason for disabling | |
| bool | $recursive Recursively disable all contained entities? |
| 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.
| string | $subtype Subtype | |
| int | $limit Limit | |
| int | $offset Offset |
Definition at line 326 of file ElggSite.php.
| ElggSite::getExportableValues | ( | ) |
Return an array of fields which can be exported.
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.
| 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 |
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.
| string | $subtype Entity subtype | |
| int | $limit Limit | |
| int | $offset Offset |
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.
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}.
| string | $url Defaults to the current URL. |
Definition at line 400 of file ElggSite.php.
| ElggSite::listMembers | ( | $ | options = array() |
) |
List the members of this site.
| array | $options An associative array for key => value parameters accepted by elgg_list_entities(). Common parameters include 'full_view', 'limit', and 'offset'. |
Definition at line 242 of file ElggSite.php.
| ElggSite::load | ( | $ | guid | ) | [protected] |
Loads the full ElggSite when given a guid.
| mixed | $guid GUID of ElggSite entity or database row object |
| InvalidClassException |
Reimplemented from ElggEntity.
Definition at line 115 of file ElggSite.php.
| ElggSite::removeObject | ( | $ | object_guid | ) |
Remvoes an object from the site.
| int | $object_guid GUID |
Definition at line 312 of file ElggSite.php.
| ElggSite::removeUser | ( | $ | user_guid | ) |
Removes a user from the site.
| int | $user_guid GUID |
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.
1.6.3