ElggObject Class Reference

Elgg Object. More...

Inheritance diagram for ElggObject:
ElggEntity ElggData Notable Locatable Importable Loggable Exportable ElggFile ElggPlugin ElggWidget

List of all members.

Public Member Functions

 __construct ($guid=null)
 Load or create a new ElggObject.
 save ()
 Saves object-specific attributes.
 getSites ($subtype="", $limit=10, $offset=0)
 Return sites that this object is a member of.
 addToSite ($site_guid)
 Add this object to a site.
 getExportableValues ()
 Return an array of fields which can be exported.
 canComment ($user_guid=0)
 Can a user comment on this object?

Protected Member Functions

 initializeAttributes ()
 Initialise the attributes array to include the type, title, and description.
 load ($guid)
 Loads the full ElggObject when given a guid.

Detailed Description

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.

Definition at line 22 of file ElggObject.php.


Constructor & Destructor Documentation

ElggObject::__construct ( guid = null  ) 

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:
mixed $guid If an int, load that GUID. If a db row, then will attempt to load the rest of the data.
Exceptions:
IOException If passed an incorrect guid
InvalidParameterException If passed an Elgg* Entity that isn't an ElggObject

Reimplemented in ElggFile, and ElggPlugin.

Definition at line 55 of file ElggObject.php.


Member Function Documentation

ElggObject::addToSite ( site_guid  ) 

Add this object to a site.

Parameters:
int $site_guid The guid of the site to add it to
Returns:
bool

Definition at line 158 of file ElggObject.php.

ElggObject::canComment ( user_guid = 0  ) 

Can a user comment on this object?

See also:
ElggEntity::canComment()
Parameters:
int $user_guid User guid (default is logged in user)
Returns:
bool
Since:
1.8.0

Reimplemented from ElggEntity.

Definition at line 187 of file ElggObject.php.

ElggObject::getExportableValues (  ) 

Return an array of fields which can be exported.

Returns:
array

Reimplemented from ElggEntity.

Definition at line 171 of file ElggObject.php.

ElggObject::getSites ( subtype = "",
limit = 10,
offset = 0 
)

Return sites that this object is a member of.

Site membership is determined by relationships and not site_guid.d

Parameters:
string $subtype Optionally, the subtype of result we want to limit to
int $limit The number of results to return
int $offset Any indexing offset
Returns:
array|false

Definition at line 147 of file ElggObject.php.

ElggObject::initializeAttributes (  )  [protected]

Initialise the attributes array to include the type, title, and description.

Returns:
void

Reimplemented from ElggEntity.

Reimplemented in ElggFile, ElggPlugin, and ElggWidget.

Definition at line 30 of file ElggObject.php.

ElggObject::load ( guid  )  [protected]

Loads the full ElggObject when given a guid.

Parameters:
mixed $guid GUID of an ElggObject or the stdClass object from entities table
Returns:
bool
Exceptions:
InvalidClassException 

Reimplemented from ElggEntity.

Definition at line 98 of file ElggObject.php.

ElggObject::save (  ) 

Saves object-specific attributes.

Reimplemented from ElggEntity.

Reimplemented in ElggFile, and ElggPlugin.

Definition at line 122 of file ElggObject.php.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations
Generated on Sat May 18 00:01:24 2013 for Elgg by  doxygen 1.6.3