Class ElggObject
Elgg Object
Elgg objects are the most common means of storing information in the
database. They are a child class of ElggEntity, so receive all the benefits of
the Entities, but also include a title and description field.
An ElggObject represents a row from the objects_entity table, as well as the
related row in the entities table as represented by the parent ElggEntity
object.
-
ElggData
implements
Loggable,
Iterator,
ArrayAccess,
Exportable
-
ElggEntity
implements
Notable,
Locatable,
Importable
-
ElggObject
Methods summary
protected
|
#
initializeAttributes( )
Initialise the attributes array to include the type, title, and
description.
Initialise the attributes array to include the type, title, and
description.
Overrides
|
public
|
#
__construct( mixed $guid = null )
Load or create a new ElggObject.
Load or create a new ElggObject.
If no arguments are passed, create a new entity.
If an argument is passed, attempt to load a full ElggObject entity. Arguments
can be: - The GUID of an object entity. - A DB result object from the entities
table with a guid property
Parameters
- $guid
mixed $guid If an int, load that GUID. If a db row, then will attempt to load the rest
of the data.
Throws
|
protected
boolean
|
#
load( mixed $guid )
Loads the full ElggObject when given a guid.
Loads the full ElggObject when given a guid.
Parameters
- $guid
mixed $guid GUID of an ElggObject or the stdClass object from entities table
Returns
boolean
Throws
Overrides
|
public
boolean
|
#
save( )
Saves object-specific attributes.
Saves object-specific attributes.
Returns
boolean
Throws
Overrides
|
public
array|false
|
#
getSites( string $subtype = "", integer $limit = 10, integer $offset = 0 )
Return sites that this object is a member of
Return sites that this object is a member of
Site membership is determined by relationships and not site_guid.d
Parameters
- $subtype
string $subtype Optionally, the subtype of result we want to limit to
- $limit
integer $limit The number of results to return
- $offset
integer $offset Any indexing offset
Returns
array|false
|
public
boolean
|
#
addToSite( integer $site_guid )
Add this object to a site
Add this object to a site
Parameters
- $site_guid
integer $site_guid The guid of the site to add it to
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
|
Methods inherited from ElggEntity
__clone(),
__unset(),
addRelationship(),
annotate(),
canAnnotate(),
canEdit(),
canEditMetadata(),
canWriteToContainer(),
countAnnotations(),
countComments(),
countEntitiesFromRelationship(),
delete(),
deleteAnnotations(),
deleteMetadata(),
deleteOwnedAnnotations(),
deleteOwnedMetadata(),
deleteRelationships(),
disable(),
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()
|
Magic properties summary
public
string
|
$title
|
#
The title, name, or summary of this object
The title, name, or summary of this object
|
public
string
|
$description
|
#
The body, description, or content of the object
The body, description, or content of the object
|
public
array
|
$tags
|
#
Array of tags that describe the object
Array of tags that describe the object
|