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. | |
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.
| 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:
| mixed | $guid If an int, load that GUID. If a db row, then will attempt to load the rest of the data. |
| 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.
| ElggObject::addToSite | ( | $ | site_guid | ) |
Add this object to a site.
| int | $site_guid The guid of the site to add it to |
Definition at line 158 of file ElggObject.php.
| ElggObject::canComment | ( | $ | user_guid = 0 |
) |
Can a user comment on this object?
| int | $user_guid User guid (default is logged in user) |
Reimplemented from ElggEntity.
Definition at line 187 of file ElggObject.php.
| ElggObject::getExportableValues | ( | ) |
Return an array of fields which can be exported.
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
| 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 |
Definition at line 147 of file ElggObject.php.
| ElggObject::initializeAttributes | ( | ) | [protected] |
Initialise the attributes array to include the type, title, and description.
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.
| mixed | $guid GUID of an ElggObject or the stdClass object from entities table |
| 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.
1.6.3