PHP Class ElggSite, Elgg

\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 holds information about a site: - name - description - url Every \ElggEntity belongs to a site.
Inheritance: extends ElggEntity
Datei anzeigen Open project: elgg/elgg Class Usage Examples

Public Methods

Method Description
__construct ( stdClass $row = null ) Create a new \ElggSite.
checkWalledGarden ( ) : void 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.
delete ( ) : boolean Delete the site.
disable ( string $reason = "", boolean $recursive = true ) : boolean Disable the site
getDisplayName ( )
getDomain ( ) : string Get the domain for this site
getExternalAttributes ( ) : array Get default values for attributes stored in a separate table
getURL ( ) : string Returns the URL for this site
isPublicPage ( string $url = '' ) : boolean Returns if a URL is public for this site when in Walled Garden mode.
setDisplayName ( $displayName )

Protected Methods

Method Description
create ( )
initializeAttributes ( ) : void Initialize the attributes array.
load ( mixed $guid ) : boolean Loads the full \ElggSite when given a guid.
prepareObject ( $object )
update ( )

Method Details

__construct() public method

Plugin developers should only use the constructor to create a new entity. To retrieve entities, use get_entity() and the elgg_get_entities* functions.
public __construct ( stdClass $row = null )
$row stdClass Database row result. Default is null to create a new site.

checkWalledGarden() public method

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
public checkWalledGarden ( ) : void
return void

create() protected method

protected create ( )

delete() public method

Delete the site.
public delete ( ) : boolean
return boolean

disable() public method

Disable the site
public disable ( string $reason = "", boolean $recursive = true ) : boolean
$reason string Optional reason for disabling
$recursive boolean Recursively disable all contained entities?
return boolean

getDisplayName() public method

public getDisplayName ( )

getDomain() public method

Get the domain for this site
Since: 1.9
public getDomain ( ) : string
return string

getExternalAttributes() final public static method

Get default values for attributes stored in a separate table
See also: Elgg\Database\EntityTable::getEntities
final public static getExternalAttributes ( ) : array
return array

getURL() public method

Returns the URL for this site
public getURL ( ) : string
return string The URL

initializeAttributes() protected method

This is vital to distinguish between metadata and base attributes.
protected initializeAttributes ( ) : void
return void

isPublicPage() public method

Pages are registered to be public by {@elgg_plugin_hook public_pages walled_garden}.
Since: 1.8.0
public isPublicPage ( string $url = '' ) : boolean
$url string Defaults to the current URL.
return boolean

load() protected method

Loads the full \ElggSite when given a guid.
protected load ( mixed $guid ) : boolean
$guid mixed GUID of \ElggSite entity or database row object
return boolean

prepareObject() protected method

protected prepareObject ( $object )

setDisplayName() public method

public setDisplayName ( $displayName )

update() protected method

protected update ( )