Overview

Packages

  • ClipIt
    • clipit
      • api
    • urjc
      • backend
  • Elgg
    • Core
      • Access
      • Authentication
      • Cache
      • Caches
      • Core
      • DataMode
        • Site
      • DataModel
        • Annotations
        • Entities
        • Extender
        • File
        • Importable
        • Loggable
        • Notable
        • Object
        • User
      • DataStorage
      • Exception
      • Exceptions
        • Stub
      • FileStore
        • Disk
      • Groups
      • Helpers
      • HMAC
      • Memcache
      • Metadata
      • Navigation
      • ODD
      • Output
      • Plugins
        • Settings
      • Sessions
      • SocialModel
        • Friendable
        • Locatable
      • WebServicesAPI
      • Widgets
      • XML
      • XMLRPC
    • Exceptions
      • Stub
  • None
  • PHP

Classes

  • ElggSite
  • Overview
  • Package
  • Class
  • Tree

Class ElggSite

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: - name - description - url

Every ElggEntity (except ElggSite) belongs to a site.

ElggData implements Loggable, Iterator, ArrayAccess, Exportable
Extended by ElggEntity implements Notable, Locatable, Importable
Extended by ElggSite
Package: Elgg\Core\DataMode\Site
Link: http://docs.elgg.org/DataModel/Sites
Warning: Multiple site support isn't fully developed.
Located at ElggSite.php
Methods summary
protected
# initializeAttributes( )

Initialise the attributes array. This is vital to distinguish between metadata and base parameters.

Initialise the attributes array. This is vital to distinguish between metadata and base parameters.

Place your base parameters here.

Overrides

ElggEntity::initializeAttributes()
public
# __construct( mixed $guid = null )

Load or create a new ElggSite.

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

$guid
mixed
$guid If an int, load that GUID. If a db row then will load the rest of the data.

Throws

IOException
If passed an incorrect guid
InvalidParameterException
If passed an Elgg* Entity that isn't an ElggSite
protected boolean
# load( mixed $guid )

Loads the full ElggSite when given a guid.

Loads the full ElggSite when given a guid.

Parameters

$guid
mixed
$guid GUID of ElggSite entity or database row object

Returns

boolean

Throws

InvalidClassException

Overrides

ElggEntity::load()
public boolean
# save( )

Saves site-specific attributes.

Saves site-specific attributes.

Returns

boolean

Throws

IOException

Overrides

ElggEntity::save()
public boolean
# delete( )

Delete the site.

Delete the site.

Returns

boolean

Throws

SecurityException

Note

You cannot delete the current site.

Overrides

ElggEntity::delete()
public boolean
# disable( string $reason = "", boolean $recursive = true )

Disable the site

Disable the site

Parameters

$reason
string
$reason Optional reason for disabling
$recursive
boolean
$recursive Recursively disable all contained entities?

Returns

boolean

Throws

SecurityException

Note

You cannot disable the current site.

Overrides

ElggEntity::disable()
public array
# getMembers( array $options = array(), integer $offset = 0 )

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

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

Parameters

$options
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
$offset
integer
$offset Offset @deprecated parameter

Returns

array
of ElggUsers
public string
# listMembers( array $options = array() )

List the members of this site

List the members of this site

Parameters

$options
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
public boolean
# addUser( integer $user_guid )

Adds a user to the site.

Adds a user to the site.

Parameters

$user_guid
integer
$user_guid GUID

Returns

boolean
public boolean
# removeUser( integer $user_guid )

Removes a user from the site.

Removes a user from the site.

Parameters

$user_guid
integer
$user_guid GUID

Returns

boolean
public array
# getObjects( string $subtype = "", integer $limit = 10, integer $offset = 0 )

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

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

Parameters

$subtype
string
$subtype Entity subtype
$limit
integer
$limit Limit
$offset
integer
$offset Offset

Returns

array

Warning

This only returns objects that have been explicitly added to the site through addObject()
public boolean
# addObject( integer $object_guid )

Adds an object to the site.

Adds an object to the site.

Parameters

$object_guid
integer
$object_guid GUID

Returns

boolean
public boolean
# removeObject( integer $object_guid )

Remvoes an object from the site.

Remvoes an object from the site.

Parameters

$object_guid
integer
$object_guid GUID

Returns

boolean
public array
# getExportableValues( )

Return an array of fields which can be exported.

Return an array of fields which can be exported.

Returns

array

Overrides

ElggEntity::getExportableValues()
public
# 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.

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.

Since

1.8.0

Link

http://docs.elgg.org/Tutorials/WalledGarden
public boolean
# isPublicPage( string $url = '' )

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

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

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

Parameters

$url
string
$url Defaults to the current URL.

Returns

boolean

Since

1.8.0
Methods inherited from ElggEntity
__clone(), __unset(), addRelationship(), annotate(), canAnnotate(), canComment(), canEdit(), canEditMetadata(), canWriteToContainer(), countAnnotations(), countComments(), countEntitiesFromRelationship(), deleteAnnotations(), deleteMetadata(), deleteOwnedAnnotations(), deleteOwnedMetadata(), deleteRelationships(), disableAnnotations(), disableMetadata(), enable(), enableAnnotations(), enableMetadata(), export(), get(), getAccessID(), getAnnotations(), getAnnotationsAvg(), getAnnotationsMax(), getAnnotationsMin(), getAnnotationsSum(), getCalendarEndTime(), getCalendarStartTime(), getContainerEntity(), getContainerGUID(), getEntitiesFromRelationship(), getGUID(), getIconURL(), getLatitude(), getLocation(), getLongitude(), getMetaData(), getObjectFromID(), getOwnerEntity(), getOwnerGUID(), getPrivateSetting(), getSubtype(), getSystemLogID(), getTags(), getTimeUpdated(), getType(), getURL(), getVolatileData(), import(), isEnabled(), isFullyLoaded(), removePrivateSetting(), removeRelationship(), set(), setCalendarTimeAndDuration(), setContainerGUID(), setLatLong(), setLocation(), setMetaData(), setPrivateSetting(), setURL(), setVolatileData()
Methods inherited from ElggData
__get(), __isset(), __set(), current(), getClassName(), getTimeCreated(), key(), next(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), rewind(), valid()
Properties inherited from ElggEntity
$icon_override, $temp_annotations, $temp_metadata, $temp_private_settings, $url_override, $volatile
Properties inherited from ElggData
$attributes, $valid
Magic properties summary
public string $name
#

The name or title of the website

The name or title of the website

public string $description
#

A motto, mission statement, or description of the website

A motto, mission statement, or description of the website

public string $url
#

The root web address for the site, including trailing slash

The root web address for the site, including trailing slash

Magic properties inherited from ElggEntity
$access_id, $container_guid, $enabled, $guid, $owner_guid, $site_guid, $subtype, $time_created, $time_updated, $type
API documentation generated by ApiGen 2.8.0