Elgg
Version 1.11
|
Public Member Functions | |
__clone () | |
Clone an entity. More... | |
__set ($name, $value) | |
Set an attribute or metadata value for this entity. More... | |
set ($name, $value) | |
Sets the value of an attribute or metadata. More... | |
__get ($name) | |
Get an attribute or metadata value. More... | |
get ($name) | |
Return the value of an attribute or metadata. More... | |
getDisplayName () | |
Get the entity's display name. More... | |
setDisplayName ($displayName) | |
Sets the title or name of this entity. More... | |
getMetadata ($name) | |
Return the value of a piece of metadata. More... | |
__unset ($name) | |
Unset a property from metadata or attribute. More... | |
setMetadata ($name, $value, $value_type= '', $multiple=false, $owner_guid=0, $access_id=null) | |
Set metadata on this entity. More... | |
deleteMetadata ($name=null) | |
Deletes all metadata on this object (metadata.entity_guid = $this->guid). More... | |
deleteOwnedMetadata ($name=null) | |
Deletes all metadata owned by this object (metadata.owner_guid = $this->guid). More... | |
clearMetadata ($name= '') | |
Remove metadata. More... | |
disableMetadata ($name= '') | |
Disables metadata for this entity, optionally based on name. More... | |
enableMetadata ($name= '') | |
Enables metadata for this entity, optionally based on name. More... | |
getVolatileData ($name) | |
Get a piece of volatile (non-persisted) data on this entity. More... | |
setVolatileData ($name, $value) | |
Set a piece of volatile (non-persisted) data on this entity. More... | |
deleteRelationships ($relationship=null) | |
Remove all relationships to and from this entity. More... | |
clearRelationships () | |
Remove all relationships to and from this entity. More... | |
addRelationship ($guid_two, $relationship) | |
Add a relationship between this an another entity. More... | |
removeRelationship ($guid_two, $relationship) | |
Remove a relationship. More... | |
setPrivateSetting ($name, $value) | |
Adds a private setting to this entity. More... | |
getPrivateSetting ($name) | |
Returns a private setting value. More... | |
removePrivateSetting ($name) | |
Removes private setting. More... | |
deleteAnnotations ($name=null) | |
Deletes all annotations on this object (annotations.entity_guid = $this->guid). More... | |
deleteOwnedAnnotations ($name=null) | |
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid). More... | |
disableAnnotations ($name= '') | |
Disables annotations for this entity, optionally based on name. More... | |
enableAnnotations ($name= '') | |
Enables annotations for this entity, optionally based on name. More... | |
annotate ($name, $value, $access_id=ACCESS_PRIVATE, $owner_guid=0, $vartype="") | |
Adds an annotation to an entity. More... | |
getAnnotations ($options=array(), $limit=50, $offset=0, $order="asc") | |
Gets an array of annotations. More... | |
clearAnnotations ($name="") | |
Remove an annotation or all annotations for this entity. More... | |
countAnnotations ($name="") | |
Count annotations. More... | |
getAnnotationsAvg ($name) | |
Get the average of an integer type annotation. More... | |
getAnnotationsSum ($name) | |
Get the sum of integer type annotations of a given name. More... | |
getAnnotationsMin ($name) | |
Get the minimum of integer type annotations of given name. More... | |
getAnnotationsMax ($name) | |
Get the maximum of integer type annotations of a given name. More... | |
countComments () | |
Count the number of comments attached to this entity. More... | |
getEntitiesFromRelationship ($options=array(), $inverse=false, $limit=50, $offset=0) | |
Gets an array of entities with a relationship to this entity. More... | |
countEntitiesFromRelationship ($relationship, $inverse_relationship=false) | |
Gets the number of entities from a specific relationship type. More... | |
canEdit ($user_guid=0) | |
Can a user edit this entity? More... | |
canDelete ($user_guid=0) | |
Can a user delete this entity? More... | |
canEditMetadata ($metadata=null, $user_guid=0) | |
Can a user edit metadata on this entity? More... | |
canWriteToContainer ($user_guid=0, $type= 'all', $subtype= 'all') | |
Can a user add an entity to this container. More... | |
canComment ($user_guid=0) | |
Can a user comment on an entity? More... | |
canAnnotate ($user_guid=0, $annotation_name= '') | |
Can a user annotate an entity? More... | |
getAccessID () | |
Returns the access_id. More... | |
getGUID () | |
Returns the guid. More... | |
getType () | |
Returns the entity type. More... | |
getSubtype () | |
Get the entity subtype. More... | |
getOwnerGUID () | |
Get the guid of the entity's owner. More... | |
getOwner () | |
Return the guid of the entity's owner. More... | |
getOwnerEntity () | |
Gets the that owns this entity. More... | |
setContainerGUID ($container_guid) | |
Set the container for this object. More... | |
setContainer ($container_guid) | |
Set the container for this object. More... | |
getContainerGUID () | |
Gets the container GUID for this entity. More... | |
getContainer () | |
Gets the container GUID for this entity. More... | |
getContainerEntity () | |
Get the container entity for this object. More... | |
getTimeUpdated () | |
Returns the UNIX epoch time that this entity was last updated. More... | |
getURL () | |
Gets the URL for this entity. More... | |
setURL ($url) | |
Overrides the URL returned by getURL() More... | |
getIconURL ($params=array()) | |
Get the URL for this entity's icon. More... | |
getIcon ($size= 'medium') | |
Returns a URL for the entity's icon. More... | |
setIcon ($url, $size= 'medium') | |
Set an icon override for an icon and size. More... | |
addToSite ($site) | |
Add this entity to a site. More... | |
removeFromSite ($site) | |
Remove this entity from a site. More... | |
getSites ($options=array()) | |
Gets the sites this entity is a member of. More... | |
isFullyLoaded () | |
Tests to see whether the object has been fully loaded. More... | |
save () | |
Save an entity. More... | |
refresh (\stdClass $row) | |
Load new data from database into existing entity. More... | |
disable ($reason="", $recursive=true) | |
Disable this entity. More... | |
enable ($recursive=true) | |
Enable the entity. More... | |
isEnabled () | |
Is this entity enabled? More... | |
delete ($recursive=true) | |
Deletes the entity. More... | |
toObject () | |
{} More... | |
getLocation () | |
Gets the 'location' metadata for the entity. More... | |
setLocation ($location) | |
Sets the 'location' metadata for the entity. More... | |
setLatLong ($lat, $long) | |
Set latitude and longitude metadata tags for a given entity. More... | |
getLatitude () | |
Return the entity's latitude. More... | |
getLongitude () | |
Return the entity's longitude. More... | |
setCalendarTimeAndDuration ($hour=null, $minute=null, $second=null, $day=null, $month=null, $year=null, $duration=null) | |
Set the time and duration of an object. More... | |
getCalendarStartTime () | |
Returns the start timestamp. More... | |
getCalendarEndTime () | |
Returns the end timestamp. More... | |
getExportableValues () | |
Returns an array of fields which can be exported. More... | |
export () | |
Export this class into an array of ODD Elements containing all necessary fields. More... | |
import (ODD $data) | |
Import data from an parsed ODD xml data array. More... | |
getSystemLogID () | |
Return an identification for the object for storage in the system log. More... | |
getObjectFromID ($id) | |
For a given ID, return the object associated with it. More... | |
getTags ($tag_names=null) | |
Returns tags for this entity. More... | |
deleteAccessCollectionMemberships () | |
Remove the membership of all access collections for this entity (if the entity is a user) More... | |
deleteOwnedAccessCollections () | |
Remove all access collections owned by this entity. More... | |
Public Member Functions inherited from ElggData | |
__isset ($name) | |
Test if property is set either as an attribute or metadata. More... | |
getURL () | |
Get a URL for this object. More... | |
save () | |
Save this data to the appropriate database table. More... | |
delete () | |
Delete this data. More... | |
getTimeCreated () | |
Returns the UNIX epoch time that this entity was created. More... | |
toObject () | |
Get a plain old object copy for public consumption. More... | |
getClassName () | |
Return the class name of the object. More... | |
getObjectOwnerGUID () | |
Return the GUID of the owner of this object. More... | |
rewind () | |
Iterator interface. More... | |
current () | |
Iterator interface. More... | |
key () | |
Iterator interface. More... | |
next () | |
Iterator interface. More... | |
valid () | |
Iterator interface. More... | |
offsetSet ($key, $value) | |
Array access interface. More... | |
offsetGet ($key) | |
Array access interface. More... | |
offsetUnset ($key) | |
Array access interface. More... | |
offsetExists ($offset) | |
Array access interface. More... | |
Protected Member Functions | |
initializeAttributes () | |
Initialize the attributes array. More... | |
create () | |
Create a new entry in the entities table. More... | |
update () | |
Update the entity in the database. More... | |
load ($guid) | |
Loads attributes from the entities table into the object. More... | |
loadAdditionalSelectValues (array $data) | |
Stores non-attributes from the loading of the entity as volatile data. More... | |
prepareObject ($object) | |
Prepare an object copy for toObject() More... | |
Protected Member Functions inherited from ElggData | |
initialise_attributes ($pre18_api=true) | |
Initialise the attributes array. More... | |
initializeAttributes () | |
Initialize the attributes array. More... | |
getDatabase () | |
Provides a pointer to the database object. More... | |
get ($name) | |
Fetch the specified attribute. More... | |
set ($name, $value) | |
Set the specified attribute. More... | |
Protected Attributes | |
$url_override | |
If set, overrides the value of getURL() More... | |
$icon_override | |
Icon override, overrides the value of getIcon(). More... | |
$temp_metadata = array() | |
Holds metadata until entity is saved. More... | |
$temp_annotations = array() | |
Holds annotations until entity is saved. More... | |
$temp_private_settings = array() | |
Holds private settings until entity is saved. More... | |
$volatile = array() | |
Volatile data structure for this object, allows for storage of data in-memory that isn't sync'd back to the metadata table. More... | |
$tables_split | |
$tables_loaded | |
Protected Attributes inherited from ElggData | |
$attributes = array() | |
The main attributes of an entity. More... | |
$valid = false | |
Definition at line 41 of file ElggEntity.php.
ElggEntity::__clone | ( | ) |
Clone an entity.
Resets the guid so that the entity can be saved as a distinct entity from the original. Creation time will be set when this new entity is saved. The owner and container guids come from the original entity. The clone method copies metadata but does not copy annotations or private settings.
Definition at line 150 of file ElggEntity.php.
ElggEntity::__get | ( | $name | ) |
Get an attribute or metadata value.
If the name matches an attribute, the attribute is returned. If metadata does not exist with that name, a null is returned.
This only returns an array if there are multiple values for a particular $name key.
string | $name | Name of the attribute or metadata |
Definition at line 252 of file ElggEntity.php.
ElggEntity::__set | ( | $name, | |
$value | |||
) |
Set an attribute or metadata value for this entity.
Anything that is not an attribute is saved as metadata.
string | $name | Name of the attribute or metadata |
mixed | $value | The value to be set |
Definition at line 197 of file ElggEntity.php.
ElggEntity::__unset | ( | $name | ) |
Unset a property from metadata or attribute.
string | $name | The name of the attribute or metadata. |
Definition at line 357 of file ElggEntity.php.
ElggEntity::addRelationship | ( | $guid_two, | |
$relationship | |||
) |
Add a relationship between this an another entity.
Read the relationship like "This entity is a $relationship of $guid_two."
int | $guid_two | GUID of the target entity of the relationship. |
string | $relationship | The type of relationship. |
Definition at line 639 of file ElggEntity.php.
ElggEntity::addToSite | ( | $site | ) |
Add this entity to a site.
This creates a 'member_of_site' relationship.
\ElggSite | $site | The site to add this entity to |
Definition at line 1511 of file ElggEntity.php.
ElggEntity::annotate | ( | $name, | |
$value, | |||
$access_id = ACCESS_PRIVATE , |
|||
$owner_guid = 0 , |
|||
$vartype = "" |
|||
) |
Adds an annotation to an entity.
string | $name | Annotation name |
mixed | $value | Annotation value |
int | $access_id | Access ID |
int | $owner_guid | GUID of the annotation owner |
string | $vartype | The type of annotation value |
Definition at line 827 of file ElggEntity.php.
ElggEntity::canAnnotate | ( | $user_guid = 0 , |
|
$annotation_name = '' |
|||
) |
Can a user annotate an entity?
Can be overridden by registering for the permissions_check:annotate, <entity type>=""> plugin hook.
If you want logged out users to annotate an object, do not call canAnnotate(). It's easier than using the plugin hook.
int | $user_guid | User guid (default is logged in user) |
string | $annotation_name | The name of the annotation (default is unspecified) |
Definition at line 1208 of file ElggEntity.php.
ElggEntity::canComment | ( | $user_guid = 0 | ) |
Can a user comment on an entity?
Can be overridden by registering for the permissions_check:comment, <entity type>=""> plugin hook.
int | $user_guid | User guid (default is logged in user) |
Definition at line 1182 of file ElggEntity.php.
ElggEntity::canDelete | ( | $user_guid = 0 | ) |
Can a user delete this entity?
Can be overridden by registering for the permissions_check:delete plugin hook.
int | $user_guid | The user GUID, optionally (default: logged in user) |
Definition at line 1081 of file ElggEntity.php.
ElggEntity::canEdit | ( | $user_guid = 0 | ) |
Can a user edit this entity?
Can be overridden by registering for the permissions_check plugin hook.
int | $user_guid | The user GUID, optionally (default: logged in user) |
Definition at line 1037 of file ElggEntity.php.
ElggEntity::canEditMetadata | ( | $metadata = null , |
|
$user_guid = 0 |
|||
) |
Can a user edit metadata on this entity?
If no specific metadata is passed, it returns whether the user can edit any metadata on the entity.
Can be overridden by by registering for the permissions_check:metadata plugin hook.
\ElggMetadata | $metadata | The piece of metadata to specifically check or null for any metadata |
int | $user_guid | The user GUID, optionally (default: logged in user) |
Definition at line 1126 of file ElggEntity.php.
ElggEntity::canWriteToContainer | ( | $user_guid = 0 , |
|
$type = 'all' , |
|||
$subtype = 'all' |
|||
) |
Can a user add an entity to this container.
int | $user_guid | The GUID of the user creating the entity (0 for logged in user). |
string | $type | The type of entity we're looking to write |
string | $subtype | The subtype of the entity we're looking to write |
Definition at line 1168 of file ElggEntity.php.
ElggEntity::clearAnnotations | ( | $name = "" | ) |
Remove an annotation or all annotations for this entity.
string | $name | Annotation name |
Definition at line 898 of file ElggEntity.php.
ElggEntity::clearMetadata | ( | $name = '' | ) |
Remove metadata.
string | $name | The name of the metadata to clear |
Definition at line 515 of file ElggEntity.php.
ElggEntity::clearRelationships | ( | ) |
Remove all relationships to and from this entity.
Definition at line 622 of file ElggEntity.php.
ElggEntity::countAnnotations | ( | $name = "" | ) |
Count annotations.
string | $name | The type of annotation. |
Definition at line 910 of file ElggEntity.php.
ElggEntity::countComments | ( | ) |
Count the number of comments attached to this entity.
Definition at line 964 of file ElggEntity.php.
ElggEntity::countEntitiesFromRelationship | ( | $relationship, | |
$inverse_relationship = false |
|||
) |
Gets the number of entities from a specific relationship type.
string | $relationship | Relationship type (eg "friends") |
bool | $inverse_relationship | Invert relationship |
Definition at line 1018 of file ElggEntity.php.
|
protected |
Create a new entry in the entities table.
Saves the base information in the entities table for the entity. Saving the type-specific information is handled in the calling class method.
InvalidParameterException | If the entity's type has not been set. |
IOException | If the new row fails to write to the DB. |
Definition at line 1610 of file ElggEntity.php.
ElggEntity::delete | ( | $recursive = true | ) |
Deletes the entity.
Removes the entity and its metadata, annotations, relationships, river entries, and private data.
Optionally can remove entities contained and owned by this entity.
bool | $recursive | If true (default) then all entities which are owned or contained by $this will also be deleted. |
Definition at line 2029 of file ElggEntity.php.
ElggEntity::deleteAccessCollectionMemberships | ( | ) |
Remove the membership of all access collections for this entity (if the entity is a user)
Definition at line 2496 of file ElggEntity.php.
ElggEntity::deleteAnnotations | ( | $name = null | ) |
Deletes all annotations on this object (annotations.entity_guid = $this->guid).
If you pass a name, only annotations matching that name will be deleted.
null | string | $name | The annotations name to remove. |
Definition at line 716 of file ElggEntity.php.
ElggEntity::deleteMetadata | ( | $name = null | ) |
Deletes all metadata on this object (metadata.entity_guid = $this->guid).
If you pass a name, only metadata matching that name will be deleted.
null | string | $name | The name of the metadata to remove. |
Definition at line 464 of file ElggEntity.php.
ElggEntity::deleteOwnedAccessCollections | ( | ) |
Remove all access collections owned by this entity.
Definition at line 2527 of file ElggEntity.php.
ElggEntity::deleteOwnedAnnotations | ( | $name = null | ) |
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid).
If you pass a name, only annotations matching that name will be deleted.
null | string | $name | The name of annotations to delete. |
Definition at line 736 of file ElggEntity.php.
ElggEntity::deleteOwnedMetadata | ( | $name = null | ) |
Deletes all metadata owned by this object (metadata.owner_guid = $this->guid).
If you pass a name, only metadata matching that name will be deleted.
null | string | $name | The name of metadata to delete. |
Definition at line 489 of file ElggEntity.php.
ElggEntity::deleteRelationships | ( | $relationship = null | ) |
Remove all relationships to and from this entity.
If you pass a relationship name, only relationships matching that name will be deleted.
null | string | $relationship | The name of the relationship to remove. |
Definition at line 608 of file ElggEntity.php.
ElggEntity::disable | ( | $reason = "" , |
|
$recursive = true |
|||
) |
Disable this entity.
Disabled entities are not returned by getter functions. To enable an entity, use ElggEntity::enable().Recursivelydisablinganentitywilldisableallentitiesownedorcontainedbytheparententity.Youcanignorethedisabledfieldbyusing@linkaccess_show_hidden_entities().@noteInternal:Disablinganentitysetsthe'enabled'columnto'no'.@paramstring$reasonOptionalreason@parambool$recursiveRecursivelydisableallcontainedentities?@returnbool@see\ElggEntity::enable()
Definition at line 1881 of file ElggEntity.php.
ElggEntity::disableAnnotations | ( | $name = '' | ) |
Disables annotations for this entity, optionally based on name.
string | $name | An options name of annotations to disable. |
Definition at line 760 of file ElggEntity.php.
ElggEntity::disableMetadata | ( | $name = '' | ) |
Disables metadata for this entity, optionally based on name.
string | $name | An options name of metadata to disable. |
Definition at line 527 of file ElggEntity.php.
ElggEntity::enable | ( | $recursive = true | ) |
Enable the entity.
bool | $recursive | Recursively enable all entities disabled with the entity? |
Definition at line 1951 of file ElggEntity.php.
ElggEntity::enableAnnotations | ( | $name = '' | ) |
Enables annotations for this entity, optionally based on name.
string | $name | An options name of annotations to enable. |
Definition at line 781 of file ElggEntity.php.
ElggEntity::enableMetadata | ( | $name = '' | ) |
Enables metadata for this entity, optionally based on name.
string | $name | An options name of metadata to enable. |
Definition at line 548 of file ElggEntity.php.
ElggEntity::export | ( | ) |
Export this class into an array of ODD Elements containing all necessary fields.
Override if you wish to return more information than can be found in $this->attributes (shouldn't happen)
Implements Exportable.
Definition at line 2317 of file ElggEntity.php.
ElggEntity::get | ( | $name | ) |
Return the value of an attribute or metadata.
string | $name | Name |
Definition at line 271 of file ElggEntity.php.
ElggEntity::getAccessID | ( | ) |
ElggEntity::getAnnotations | ( | $options = array() , |
|
$limit = 50 , |
|||
$offset = 0 , |
|||
$order = "asc" |
|||
) |
Gets an array of annotations.
To retrieve annotations on an unsaved entity, pass array('name' => [annotation name]) as the options array.
array | $options | Array of options for elgg_get_annotations() except guid. This may be passed a string annotation name, but this usage is deprecated. |
int | $limit | Limit (deprecated) |
int | $offset | Offset (deprecated) |
string | $order | Order by time: asc or desc (deprecated) |
Definition at line 851 of file ElggEntity.php.
ElggEntity::getAnnotationsAvg | ( | $name | ) |
Get the average of an integer type annotation.
string | $name | Annotation name |
Definition at line 921 of file ElggEntity.php.
ElggEntity::getAnnotationsMax | ( | $name | ) |
Get the maximum of integer type annotations of a given name.
string | $name | Annotation name |
Definition at line 954 of file ElggEntity.php.
ElggEntity::getAnnotationsMin | ( | $name | ) |
Get the minimum of integer type annotations of given name.
string | $name | Annotation name |
Definition at line 943 of file ElggEntity.php.
ElggEntity::getAnnotationsSum | ( | $name | ) |
Get the sum of integer type annotations of a given name.
string | $name | Annotation name |
Definition at line 932 of file ElggEntity.php.
ElggEntity::getCalendarEndTime | ( | ) |
Returns the end timestamp.
Implements Notable.
Definition at line 2280 of file ElggEntity.php.
ElggEntity::getCalendarStartTime | ( | ) |
Returns the start timestamp.
Implements Notable.
Definition at line 2269 of file ElggEntity.php.
ElggEntity::getContainer | ( | ) |
ElggEntity::getContainerEntity | ( | ) |
Get the container entity for this object.
Definition at line 1346 of file ElggEntity.php.
ElggEntity::getContainerGUID | ( | ) |
|
abstract |
Get the entity's display name.
ElggEntity::getEntitiesFromRelationship | ( | $options = array() , |
|
$inverse = false , |
|||
$limit = 50 , |
|||
$offset = 0 |
|||
) |
Gets an array of entities with a relationship to this entity.
array | $options | Options array. See elgg_get_entities_from_relationship() for a list of options. 'relationship_guid' is set to this entity. |
bool | $inverse | Is this an inverse relationship? (deprecated) |
int | $limit | Number of elements to return (deprecated) |
int | $offset | Indexing offset (deprecated) |
Definition at line 994 of file ElggEntity.php.
ElggEntity::getExportableValues | ( | ) |
Returns an array of fields which can be exported.
Implements Exportable.
Definition at line 2295 of file ElggEntity.php.
ElggEntity::getGUID | ( | ) |
ElggEntity::getIcon | ( | $size = 'medium' | ) |
Returns a URL for the entity's icon.
string | $size | Either 'large', 'medium', 'small' or 'tiny' |
Definition at line 1470 of file ElggEntity.php.
ElggEntity::getIconURL | ( | $params = array() | ) |
Get the URL for this entity's icon.
Plugins can register for the 'entity:icon:url', <type> plugin hook to customize the icon for an entity.
mixed | $params | A string defining the size of the icon (e.g. tiny, small, medium, large) or an array of parameters including 'size' |
Definition at line 1435 of file ElggEntity.php.
ElggEntity::getLatitude | ( | ) |
Return the entity's latitude.
Implements Locatable.
Definition at line 2215 of file ElggEntity.php.
ElggEntity::getLocation | ( | ) |
Gets the 'location' metadata for the entity.
Implements Locatable.
Definition at line 2180 of file ElggEntity.php.
ElggEntity::getLongitude | ( | ) |
Return the entity's longitude.
Implements Locatable.
Definition at line 2225 of file ElggEntity.php.
ElggEntity::getMetadata | ( | $name | ) |
Return the value of a piece of metadata.
string | $name | Name |
Definition at line 298 of file ElggEntity.php.
ElggEntity::getObjectFromID | ( | $id | ) |
For a given ID, return the object associated with it.
This is used by the system log. It can be called on any Loggable object.
int | $id | GUID. |
Implements Loggable.
Definition at line 2450 of file ElggEntity.php.
ElggEntity::getOwner | ( | ) |
Return the guid of the entity's owner.
Definition at line 1282 of file ElggEntity.php.
ElggEntity::getOwnerEntity | ( | ) |
Gets the that owns this entity.
Definition at line 1292 of file ElggEntity.php.
ElggEntity::getOwnerGUID | ( | ) |
Get the guid of the entity's owner.
Definition at line 1272 of file ElggEntity.php.
ElggEntity::getPrivateSetting | ( | $name | ) |
Returns a private setting value.
string | $name | Name of the private setting |
Definition at line 684 of file ElggEntity.php.
ElggEntity::getSites | ( | $options = array() | ) |
Gets the sites this entity is a member of.
Site membership is determined by relationships and not site_guid.
array | $options | Options array for elgg_get_entities_from_relationship() Parameters set automatically by this method: 'relationship', 'relationship_guid', 'inverse_relationship' |
Definition at line 1549 of file ElggEntity.php.
ElggEntity::getSubtype | ( | ) |
Get the entity subtype.
Implements Loggable.
Definition at line 1259 of file ElggEntity.php.
ElggEntity::getSystemLogID | ( | ) |
Return an identification for the object for storage in the system log.
This id must be an integer.
Implements Loggable.
Definition at line 2439 of file ElggEntity.php.
ElggEntity::getTags | ( | $tag_names = null | ) |
Returns tags for this entity.
array | $tag_names | Optionally restrict by tag metadata names. |
Definition at line 2463 of file ElggEntity.php.
ElggEntity::getTimeUpdated | ( | ) |
Returns the UNIX epoch time that this entity was last updated.
Definition at line 1355 of file ElggEntity.php.
ElggEntity::getType | ( | ) |
Returns the entity type.
Implements Loggable.
Definition at line 1250 of file ElggEntity.php.
ElggEntity::getURL | ( | ) |
Gets the URL for this entity.
Plugins can register for the 'entity:url', <type> plugin hook to customize the url for an entity.
Definition at line 1367 of file ElggEntity.php.
ElggEntity::getVolatileData | ( | $name | ) |
Get a piece of volatile (non-persisted) data on this entity.
string | $name | The name of the volatile data |
Definition at line 567 of file ElggEntity.php.
ElggEntity::import | ( | ODD | $data | ) |
Import data from an parsed ODD xml data array.
ODD | $data | XML data |
InvalidParameterException |
Implements Importable.
Definition at line 2409 of file ElggEntity.php.
|
protected |
Initialize the attributes array.
This is vital to distinguish between metadata and base parameters.
Definition at line 102 of file ElggEntity.php.
ElggEntity::isEnabled | ( | ) |
Is this entity enabled?
Definition at line 2008 of file ElggEntity.php.
ElggEntity::isFullyLoaded | ( | ) |
Tests to see whether the object has been fully loaded.
Definition at line 1565 of file ElggEntity.php.
|
protected |
Loads attributes from the entities table into the object.
mixed | $guid | GUID of entity or object from entities table |
Definition at line 1790 of file ElggEntity.php.
|
protected |
Stores non-attributes from the loading of the entity as volatile data.
array | $data | Key value array |
Definition at line 1837 of file ElggEntity.php.
|
protected |
Prepare an object copy for toObject()
\stdClass | $object | Object representation of the entity |
Definition at line 2157 of file ElggEntity.php.
ElggEntity::refresh | ( | \stdClass | $row | ) |
Load new data from database into existing entity.
Overwrites data but does not change values not included in the latest data.
Definition at line 1855 of file ElggEntity.php.
ElggEntity::removeFromSite | ( | $site | ) |
Remove this entity from a site.
This deletes the 'member_of_site' relationship.
\ElggSite | $site | The site to remove this entity from |
Definition at line 1529 of file ElggEntity.php.
ElggEntity::removePrivateSetting | ( | $name | ) |
Removes private setting.
string | $name | Name of the private setting |
Definition at line 702 of file ElggEntity.php.
ElggEntity::removeRelationship | ( | $guid_two, | |
$relationship | |||
) |
Remove a relationship.
int | $guid_two | GUID of the target entity of the relationship. |
string | $relationship | The type of relationship. |
Definition at line 653 of file ElggEntity.php.
ElggEntity::save | ( | ) |
Save an entity.
InvalidParameterException | |
IOException |
Definition at line 1576 of file ElggEntity.php.
ElggEntity::set | ( | $name, | |
$value | |||
) |
Sets the value of an attribute or metadata.
string | $name | Name |
mixed | $value | Value |
Definition at line 233 of file ElggEntity.php.
ElggEntity::setCalendarTimeAndDuration | ( | $hour = null , |
|
$minute = null , |
|||
$second = null , |
|||
$day = null , |
|||
$month = null , |
|||
$year = null , |
|||
$duration = null |
|||
) |
Set the time and duration of an object.
int | $hour | If ommitted, now is assumed. |
int | $minute | If ommitted, now is assumed. |
int | $second | If ommitted, now is assumed. |
int | $day | If ommitted, now is assumed. |
int | $month | If ommitted, now is assumed. |
int | $year | If ommitted, now is assumed. |
int | $duration | Duration of event, remainder of the day is assumed. |
Implements Notable.
Definition at line 2247 of file ElggEntity.php.
ElggEntity::setContainer | ( | $container_guid | ) |
Set the container for this object.
int | $container_guid | The ID of the container. |
Definition at line 1315 of file ElggEntity.php.
ElggEntity::setContainerGUID | ( | $container_guid | ) |
Set the container for this object.
int | $container_guid | The ID of the container. |
Definition at line 1303 of file ElggEntity.php.
|
abstract |
Sets the title or name of this entity.
string | $displayName | The title or name of this entity. |
ElggEntity::setIcon | ( | $url, | |
$size = 'medium' |
|||
) |
Set an icon override for an icon and size.
string | $url | The url of the icon. |
string | $size | The size its for. |
Definition at line 1486 of file ElggEntity.php.
ElggEntity::setLatLong | ( | $lat, | |
$long | |||
) |
Set latitude and longitude metadata tags for a given entity.
float | $lat | Latitude |
float | $long | Longitude |
Implements Locatable.
Definition at line 2204 of file ElggEntity.php.
ElggEntity::setLocation | ( | $location | ) |
Sets the 'location' metadata for the entity.
string | $location | String representation of the location |
Implements Locatable.
Definition at line 2191 of file ElggEntity.php.
ElggEntity::setMetadata | ( | $name, | |
$value, | |||
$value_type = '' , |
|||
$multiple = false , |
|||
$owner_guid = 0 , |
|||
$access_id = null |
|||
) |
Set metadata on this entity.
Plugin developers usually want to use the magic set method ($entity->name = 'value'). Use this method if you want to explicitly set the owner or access of the metadata. You cannot set the owner/access before the entity has been saved.
string | $name | Name of the metadata |
mixed | $value | Value of the metadata (doesn't support assoc arrays) |
string | $value_type | 'text', 'integer', or '' for automatic detection |
bool | $multiple | Allow multiple values for a single name. Does not support associative arrays. |
int | $owner_guid | GUID of entity that owns the metadata. Default is owner of entity. |
int | $access_id | Who can read the metadata relative to the owner. Default is the access level of the entity. |
InvalidArgumentException |
Definition at line 385 of file ElggEntity.php.
ElggEntity::setPrivateSetting | ( | $name, | |
$value | |||
) |
Adds a private setting to this entity.
Private settings are similar to metadata but will not be searched and there are fewer helper functions for them.
string | $name | Name of private setting |
mixed | $value | Value of private setting |
Definition at line 668 of file ElggEntity.php.
ElggEntity::setURL | ( | $url | ) |
Overrides the URL returned by getURL()
string | $url | The new item URL |
Definition at line 1418 of file ElggEntity.php.
ElggEntity::setVolatileData | ( | $name, | |
$value | |||
) |
Set a piece of volatile (non-persisted) data on this entity.
string | $name | Name |
mixed | $value | Value |
Definition at line 587 of file ElggEntity.php.
ElggEntity::toObject | ( | ) |
{}
Definition at line 2144 of file ElggEntity.php.
|
protected |
Update the entity in the database.
InvalidParameterException |
Definition at line 1713 of file ElggEntity.php.
|
protected |
Icon override, overrides the value of getIcon().
Definition at line 55 of file ElggEntity.php.
|
protected |
Definition at line 93 of file ElggEntity.php.
|
protected |
Definition at line 86 of file ElggEntity.php.
|
protected |
Holds annotations until entity is saved.
Once the entity is saved, annotations are written immediately to the database.
Definition at line 67 of file ElggEntity.php.
|
protected |
Holds metadata until entity is saved.
Once the entity is saved, metadata are written immediately to the database.
Definition at line 61 of file ElggEntity.php.
|
protected |
Holds private settings until entity is saved.
Once the entity is saved, private settings are written immediately to the database.
Definition at line 73 of file ElggEntity.php.
|
protected |
If set, overrides the value of getURL()
Definition at line 50 of file ElggEntity.php.
|
protected |
Volatile data structure for this object, allows for storage of data in-memory that isn't sync'd back to the metadata table.
Definition at line 79 of file ElggEntity.php.