Property | Type | Description | |
---|---|---|---|
$orig_attributes | Holds the original (persisted) attribute values that have been changed but not yet saved. | ||
$temp_annotations | Holds annotations until entity is saved. Once the entity is saved, annotations are written immediately to the database. | ||
$temp_metadata | Holds metadata until entity is saved. Once the entity is saved, metadata are written immediately to the database. | ||
$temp_private_settings | Holds private settings until entity is saved. Once the entity is saved, private settings are written immediately to the database. | ||
$url_override | If set, overrides the value of getURL() | ||
$volatile | Volatile data structure for this object, allows for storage of data in-memory that isn't sync'd back to the metadata table. |
Method | Description | |
---|---|---|
__clone ( ) : void | Clone an entity | |
__get ( string $name ) : mixed | Get an attribute or metadata value | |
__set ( string $name, mixed $value ) : void | Set an attribute or metadata value for this entity | |
__unset ( string $name ) : void | Unset a property from metadata or attribute. | |
addRelationship ( integer $guid_two, string $relationship ) : boolean | Add a relationship between this an another entity. | |
annotate ( string $name, mixed $value, integer $access_id = ACCESS_PRIVATE, integer $owner_guid, string $vartype = "" ) : boolean | integer | Adds an annotation to an entity. | |
canAnnotate ( integer $user_guid, string $annotation_name = '' ) : boolean | Can a user annotate an entity? | |
canComment ( integer $user_guid, boolean $default = null ) : boolean | Can a user comment on an entity? | |
canDelete ( integer $user_guid ) : boolean | Can a user delete this entity? | |
canEdit ( integer $user_guid ) : boolean | Can a user edit this entity? | |
canEditMetadata ( ElggMetadata $metadata = null, integer $user_guid ) : boolean | Can a user edit metadata on this entity? | |
canWriteToContainer ( integer $user_guid, string $type = 'all', string $subtype = 'all' ) : boolean | Can a user add an entity to this container | |
countAnnotations ( string $name = "" ) : integer | Count annotations. | |
countComments ( ) : integer | Count the number of comments attached to this entity. | |
countEntitiesFromRelationship ( string $relationship, boolean $inverse_relationship = false ) : integer | false | Gets the number of entities from a specific relationship type | |
delete ( boolean $recursive = true ) : boolean | Deletes the entity. | |
deleteAccessCollectionMemberships ( ) : boolean | Remove the membership of all access collections for this entity (if the entity is a user) | |
deleteAnnotations ( null | string $name = null ) : boolean | Deletes all annotations on this object (annotations.entity_guid = $this->guid). | |
deleteIcon ( string $type = 'icon' ) : boolean | Removes all icon files and metadata for the passed type of icon. | |
deleteMetadata ( null | string $name = null ) : boolean | Deletes all metadata on this object (metadata.entity_guid = $this->guid). | |
deleteOwnedAccessCollections ( ) : boolean | Remove all access collections owned by this entity | |
deleteOwnedAnnotations ( null | string $name = null ) : boolean | Deletes all annotations owned by this object (annotations.owner_guid = $this->guid). | |
deleteOwnedMetadata ( null | string $name = null ) : boolean | Deletes all metadata owned by this object (metadata.owner_guid = $this->guid). | |
deleteRelationships ( null | string $relationship = null ) : boolean | Remove all relationships to and from this entity. | |
disable ( string $reason = "", boolean $recursive = true ) : boolean | Disable this entity. | |
disableAnnotations ( string $name = '' ) : boolean | Disables annotations for this entity, optionally based on name. | |
disableMetadata ( string $name = '' ) : boolean | Disables metadata for this entity, optionally based on name. | |
enable ( boolean $recursive = true ) : boolean | Enable the entity | |
enableAnnotations ( string $name = '' ) : boolean | Enables annotations for this entity, optionally based on name. | |
enableMetadata ( string $name = '' ) : boolean | Enables metadata for this entity, optionally based on name. | |
getAccessID ( ) : integer | Returns the access_id. | |
getAnnotations ( array $options = [] ) : array | Gets an array of annotations. | |
getAnnotationsAvg ( string $name ) : integer | Get the average of an integer type annotation. | |
getAnnotationsMax ( string $name ) : integer | Get the maximum of integer type annotations of a given name. | |
getAnnotationsMin ( string $name ) : integer | Get the minimum of integer type annotations of given name. | |
getAnnotationsSum ( string $name ) : integer | Get the sum of integer type annotations of a given name. | |
getContainerEntity ( ) : ElggEntity | Get the container entity for this object. | |
getContainerGUID ( ) : integer | Gets the container GUID for this entity. | |
getDisplayName ( ) : string | Get the entity's display name | |
getEntitiesFromRelationship ( array $options = [] ) : array | false | Gets an array of entities with a relationship to this entity. | |
getGUID ( ) : integer | null | Returns the guid. | |
getIcon ( string $size, string $type = 'icon' ) : ElggIcon | Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore | |
getIconLastChange ( string $size, string $type = 'icon' ) : integer | null | Returns the timestamp of when the icon was changed. | |
getIconURL ( mixed $params = [] ) : string | Get the URL for this entity's icon | |
getLatitude ( ) : float | Return the entity's latitude. | |
getLocation ( ) : string | Gets the 'location' metadata for the entity | |
getLongitude ( ) : float | Return the entity's longitude | |
getMetadata ( string $name ) : mixed | Return the value of a piece of metadata. | |
getObjectFromID ( integer $id ) : integer | For a given ID, return the object associated with it. | |
getOriginalAttributes ( ) : array | Get the original values of attribute(s) that have been modified since the entity was persisted. | |
getOwnerEntity ( ) : ElggEntity | Gets the \ElggEntity that owns this entity. | |
getOwnerGUID ( ) : integer | Get the guid of the entity's owner. | |
getPrivateSetting ( string $name ) : mixed | Returns a private setting value | |
getSubtype ( ) : string | Get the entity subtype | |
getSystemLogID ( ) : integer | Return an identification for the object for storage in the system log. | |
getTags ( array $tag_names = null ) : array | Returns tags for this entity. | |
getTimeUpdated ( ) : integer | Returns the UNIX epoch time that this entity was last updated | |
getType ( ) : string | Returns the entity type | |
getURL ( ) : string | Gets the URL for this entity. | |
getVolatileData ( string $name ) : mixed | Get a piece of volatile (non-persisted) data on this entity. | |
hasIcon ( string $size, string $type = 'icon' ) : boolean | Returns if the entity has an icon of the passed type. | |
isEnabled ( ) : boolean | Is this entity enabled? | |
isFullyLoaded ( ) : boolean | Tests to see whether the object has been persisted. | |
refresh ( stdClass $row ) : boolean | Load new data from database into existing entity. Overwrites data but does not change values not included in the latest data. | |
removePrivateSetting ( string $name ) : boolean | Removes private setting | |
removeRelationship ( integer $guid_two, string $relationship ) : boolean | Remove a relationship | |
save ( ) : boolean | integer | Save an entity. | |
saveIconFromElggFile ( ElggFile $file, string $type = 'icon', array $coords = [] ) : boolean | Saves icons using a file located in the data store as the source. | |
saveIconFromLocalFile ( string $filename, string $type = 'icon', array $coords = [] ) : boolean | Saves icons using a local file as the source. | |
saveIconFromUploadedFile ( string $input_name, string $type = 'icon', array $coords = [] ) : boolean | Saves icons using an uploaded file as the source. | |
setContainerGUID ( integer $container_guid ) : boolean | Set the container for this object. | |
setDisplayName ( string $displayName ) : void | Sets the title or name of this entity. | |
setLatLong ( float $lat, float $long ) : void | Set latitude and longitude metadata tags for a given entity. | |
setLocation ( string $location ) : void | Sets the 'location' metadata for the entity | |
setMetadata ( string $name, mixed $value, string $value_type = '', boolean $multiple = false, integer $owner_guid, integer $access_id = null ) : boolean | Set metadata on this entity. | |
setPrivateSetting ( string $name, mixed $value ) : boolean | Adds a private setting to this entity. | |
setVolatileData ( string $name, mixed $value ) : void | Set a piece of volatile (non-persisted) data on this entity | |
storeInPersistedCache ( ElggSharedMemoryCache $cache, integer $last_action ) : void | Cache the entity in a persisted cache | |
toObject ( ) | ||
updateLastAction ( integer $posted = null ) : integer | false | Update the last_action column in the entities table. |
Method | Description | |
---|---|---|
create ( ) : integer | Create a new entry in the entities table. | |
initializeAttributes ( ) : void | Initialize the attributes array. | |
load ( mixed $guid ) : boolean | Loads attributes from the entities table into the object. | |
loadAdditionalSelectValues ( array $data ) : void | Stores non-attributes from the loading of the entity as volatile data | |
prepareObject ( stdClass $object ) : stdClass | Prepare an object copy for toObject() | |
update ( ) : boolean | Update the entity in the database. |
Method | Description | |
---|---|---|
getAnnotationCalculation ( string $name, string $calculation ) : mixed | Helper function to return annotation calculation results |
public annotate ( string $name, mixed $value, integer $access_id = ACCESS_PRIVATE, integer $owner_guid, string $vartype = "" ) : boolean | integer | ||
$name | string | Annotation name |
$value | mixed | Annotation value |
$access_id | integer | Access ID |
$owner_guid | integer | GUID of the annotation owner |
$vartype | string | The type of annotation value |
return | boolean | integer | Returns int if an annotation is saved |
public canEditMetadata ( ElggMetadata $metadata = null, integer $user_guid ) : boolean | ||
$metadata | ElggMetadata | The piece of metadata to specifically check or null for any metadata |
$user_guid | integer | The user GUID, optionally (default: logged in user) |
return | boolean |
public canWriteToContainer ( integer $user_guid, string $type = 'all', string $subtype = 'all' ) : boolean | ||
$user_guid | integer | The GUID of the user creating the entity (0 for logged in user). |
$type | string | The type of entity we're looking to write |
$subtype | string | The subtype of the entity we're looking to write |
return | boolean |
public countAnnotations ( string $name = "" ) : integer | ||
$name | string | The type of annotation. |
return | integer |
public countComments ( ) : integer | ||
return | integer | Number of comments |
public deleteAccessCollectionMemberships ( ) : boolean | ||
return | boolean |
public deleteIcon ( string $type = 'icon' ) : boolean | ||
$type | string | The name of the icon. e.g., 'icon', 'cover_photo' |
return | boolean |
public deleteOwnedAccessCollections ( ) : boolean | ||
return | boolean |
public disableAnnotations ( string $name = '' ) : boolean | ||
$name | string | An options name of annotations to disable. |
return | boolean |
public disableMetadata ( string $name = '' ) : boolean | ||
$name | string | An options name of metadata to disable. |
return | boolean |
public enableAnnotations ( string $name = '' ) : boolean | ||
$name | string | An options name of annotations to enable. |
return | boolean |
public enableMetadata ( string $name = '' ) : boolean | ||
$name | string | An options name of metadata to enable. |
return | boolean |
public getAccessID ( ) : integer | ||
return | integer | The access ID |
public getAnnotations ( array $options = [] ) : array | ||
$options | array | Array of options for elgg_get_annotations() except guid. |
return | array |
public getAnnotationsAvg ( string $name ) : integer | ||
$name | string | Annotation name |
return | integer |
public getAnnotationsMax ( string $name ) : integer | ||
$name | string | Annotation name |
return | integer |
public getAnnotationsMin ( string $name ) : integer | ||
$name | string | Annotation name |
return | integer |
public getAnnotationsSum ( string $name ) : integer | ||
$name | string | Annotation name |
return | integer |
public getContainerEntity ( ) : ElggEntity | ||
return | ElggEntity |
public getContainerGUID ( ) : integer | ||
return | integer |
abstract public getDisplayName ( ) : string | ||
return | string | The title or name of this entity. |
public getEntitiesFromRelationship ( array $options = [] ) : array | false | ||
$options | array | Options array. See elgg_get_entities_from_relationship() for a list of options. 'relationship_guid' is set to this entity. |
return | array | false | An array of entities or false on failure |
public getIconURL ( mixed $params = [] ) : string | ||
$params | mixed | A string defining the size of the icon (e.g. tiny, small, medium, large) or an array of parameters including 'size' |
return | string | The URL |
public getLatitude ( ) : float | ||
return | float |
public getLocation ( ) : string | ||
return | string | The location |
public getLongitude ( ) : float | ||
return | float |
public getMetadata ( string $name ) : mixed | ||
$name | string | Name |
return | mixed | The value, or null if not found. |
public getObjectFromID ( integer $id ) : integer | ||
$id | integer | GUID. |
return | integer | GUID |
public getOriginalAttributes ( ) : array | ||
return | array |
public getOwnerEntity ( ) : ElggEntity | ||
return | ElggEntity | The owning entity |
public getOwnerGUID ( ) : integer | ||
return | integer | The owner GUID |
public getPrivateSetting ( string $name ) : mixed | ||
$name | string | Name of the private setting |
return | mixed | Null if the setting does not exist |
public getSubtype ( ) : string | ||
return | string | The entity subtype |
public getSystemLogID ( ) : integer | ||
return | integer |
public getTimeUpdated ( ) : integer | ||
return | integer | UNIX epoch time |
public getVolatileData ( string $name ) : mixed | ||
$name | string | The name of the volatile data |
return | mixed | The value or null if not found. |
protected initializeAttributes ( ) : void | ||
return | void |
public isFullyLoaded ( ) : boolean | ||
return | boolean |
protected loadAdditionalSelectValues ( array $data ) : void | ||
$data | array | Key value array |
return | void |
protected prepareObject ( stdClass $object ) : stdClass | ||
$object | stdClass | Object representation of the entity |
return | stdClass |
public removePrivateSetting ( string $name ) : boolean | ||
$name | string | Name of the private setting |
return | boolean |
public setContainerGUID ( integer $container_guid ) : boolean | ||
$container_guid | integer | The ID of the container. |
return | boolean |
abstract public setDisplayName ( string $displayName ) : void | ||
$displayName | string | The title or name of this entity. |
return | void |
public setLocation ( string $location ) : void | ||
$location | string | String representation of the location |
return | void |
public setMetadata ( string $name, mixed $value, string $value_type = '', boolean $multiple = false, integer $owner_guid, integer $access_id = null ) : boolean | ||
$name | string | Name of the metadata |
$value | mixed | Value of the metadata (doesn't support assoc arrays) |
$value_type | string | 'text', 'integer', or '' for automatic detection |
$multiple | boolean | Allow multiple values for a single name. Does not support associative arrays. |
$owner_guid | integer | GUID of entity that owns the metadata. Default is owner of entity. |
$access_id | integer | Who can read the metadata relative to the owner (deprecated). Default is the access level of the entity. Use ACCESS_PUBLIC for compatibility with Elgg 3.0 |
return | boolean |
public storeInPersistedCache ( ElggSharedMemoryCache $cache, integer $last_action ) : void | ||
$cache | ElggSharedMemoryCache | Memcache or null cache |
$last_action | integer | Last action time |
return | void |
public updateLastAction ( integer $posted = null ) : integer | false | ||
$posted | integer | Timestamp of last action |
return | integer | false |
protected $orig_attributes |
protected $temp_annotations |
protected $temp_metadata |
protected $temp_private_settings |