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

  • ElggObject
  • Overview
  • Package
  • Class
  • Tree

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
Extended by ElggEntity implements Notable, Locatable, Importable
Extended by ElggObject

Direct known subclasses

ElggFile, ElggPlugin, ElggWidget
Package: Elgg\Core\DataModel\Object
Located at ElggObject.php
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

ElggEntity::initializeAttributes()
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

IOException
If passed an incorrect guid
InvalidParameterException
If passed an Elgg* Entity that isn't an ElggObject
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

InvalidClassException

Overrides

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

Saves object-specific attributes.

Saves object-specific attributes.

Returns

boolean

Throws

IOException

Overrides

ElggEntity::save()
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

ElggEntity::getExportableValues()
public boolean
# canComment( integer $user_guid = 0 )

Can a user comment on this object?

Can a user comment on this object?

Parameters

$user_guid
integer
$user_guid User guid (default is logged in user)

Returns

boolean

Since

1.8.0

See

ElggEntity::canComment()

Overrides

ElggEntity::canComment()
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()
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 $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

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