PHP Класс ElggEntity, Elgg

Автор: Curverider Ltd ([email protected])
Наследование: implements Notable, implements Locatable, implements Exportable, implements Importable, implements Loggable, implements Iterator, implements ArrayAccess
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
getAnnotationCalculation ( string $name, string $calculation ) : mixed Helper function to return annotation calculation results

Описание методов

__clone() публичный Метод

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.
public __clone ( ) : void
Результат void

__get() публичный Метод

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.
public __get ( string $name ) : mixed
$name string Name of the attribute or metadata
Результат mixed

__set() публичный Метод

Anything that is not an attribute is saved as metadata.
См. также: ElggEntity::setMetadata()
public __set ( string $name, mixed $value ) : void
$name string Name of the attribute or metadata
$value mixed The value to be set
Результат void

__unset() публичный Метод

Unset a property from metadata or attribute.
public __unset ( string $name ) : void
$name string The name of the attribute or metadata.
Результат void

addRelationship() публичный Метод

Add a relationship between this an another entity.
См. также: ElggEntity::removeRelationship()
См. также: ElggEntity::deleteRelationships()
public addRelationship ( integer $guid_two, string $relationship ) : boolean
$guid_two integer GUID of the target entity of the relationship.
$relationship string The type of relationship.
Результат boolean

annotate() публичный Метод

Adds an annotation to an entity.
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
Результат boolean | integer Returns int if an annotation is saved

canAnnotate() публичный Метод

Can a user annotate an entity?
public canAnnotate ( integer $user_guid, string $annotation_name = '' ) : boolean
$user_guid integer User guid (default is logged in user)
$annotation_name string The name of the annotation (default is unspecified)
Результат boolean

canComment() публичный Метод

Can a user comment on an entity?
public canComment ( integer $user_guid, boolean $default = null ) : boolean
$user_guid integer User guid (default is logged in user)
$default boolean Default permission
Результат boolean

canDelete() публичный Метод

Can a user delete this entity?
См. также: elgg_set_ignore_access()
С версии: 1.11
public canDelete ( integer $user_guid ) : boolean
$user_guid integer The user GUID, optionally (default: logged in user)
Результат boolean Whether this entity is deletable by the given user.

canEdit() публичный Метод

Can a user edit this entity?
См. также: elgg_set_ignore_access()
public canEdit ( integer $user_guid ) : boolean
$user_guid integer The user GUID, optionally (default: logged in user)
Результат boolean Whether this entity is editable by the given user.

canEditMetadata() публичный Метод

If no specific metadata is passed, it returns whether the user can edit any metadata on the entity.
См. также: elgg_set_ignore_access()
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)
Результат boolean

canWriteToContainer() публичный Метод

Can a user add an entity to this container
См. также: elgg_set_ignore_access()
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
Результат boolean

countAnnotations() публичный Метод

Count annotations.
public countAnnotations ( string $name = "" ) : integer
$name string The type of annotation.
Результат integer

countComments() публичный Метод

Count the number of comments attached to this entity.
С версии: 1.8.0
public countComments ( ) : integer
Результат integer Number of comments

countEntitiesFromRelationship() публичный Метод

Gets the number of entities from a specific relationship type
public countEntitiesFromRelationship ( string $relationship, boolean $inverse_relationship = false ) : integer | false
$relationship string Relationship type (eg "friends")
$inverse_relationship boolean Invert relationship
Результат integer | false The number of entities or false on failure

create() защищенный Метод

Saves the base information in the entities table for the entity. Saving the type-specific information is handled in the calling class method.
protected create ( ) : integer
Результат integer The new entity's GUID

delete() публичный Метод

Removes the entity and its metadata, annotations, relationships, river entries, and private data. Optionally can remove entities contained and owned by this entity.
public delete ( boolean $recursive = true ) : boolean
$recursive boolean If true (default) then all entities which are owned or contained by $this will also be deleted.
Результат boolean

deleteAccessCollectionMemberships() публичный Метод

Remove the membership of all access collections for this entity (if the entity is a user)
С версии: 1.11
public deleteAccessCollectionMemberships ( ) : boolean
Результат boolean

deleteAnnotations() публичный Метод

If you pass a name, only annotations matching that name will be deleted.
С версии: 1.8
public deleteAnnotations ( null | string $name = null ) : boolean
$name null | string The annotations name to remove.
Результат boolean

deleteIcon() публичный Метод

Removes all icon files and metadata for the passed type of icon.
public deleteIcon ( string $type = 'icon' ) : boolean
$type string The name of the icon. e.g., 'icon', 'cover_photo'
Результат boolean

deleteMetadata() публичный Метод

If you pass a name, only metadata matching that name will be deleted.
С версии: 1.8
public deleteMetadata ( null | string $name = null ) : boolean
$name null | string The name of the metadata to remove.
Результат boolean

deleteOwnedAccessCollections() публичный Метод

Remove all access collections owned by this entity
С версии: 1.11
public deleteOwnedAccessCollections ( ) : boolean
Результат boolean

deleteOwnedAnnotations() публичный Метод

If you pass a name, only annotations matching that name will be deleted.
С версии: 1.8
public deleteOwnedAnnotations ( null | string $name = null ) : boolean
$name null | string The name of annotations to delete.
Результат boolean

deleteOwnedMetadata() публичный Метод

If you pass a name, only metadata matching that name will be deleted.
С версии: 1.8
public deleteOwnedMetadata ( null | string $name = null ) : boolean
$name null | string The name of metadata to delete.
Результат boolean

deleteRelationships() публичный Метод

If you pass a relationship name, only relationships matching that name will be deleted.
См. также: ElggEntity::addRelationship()
См. также: ElggEntity::removeRelationship()
public deleteRelationships ( null | string $relationship = null ) : boolean
$relationship null | string The name of the relationship to remove.
Результат boolean

disable() публичный Метод

Disabled entities are not returned by getter functions. To enable an entity, use {@link \ElggEntity::enable()}. Recursively disabling an entity will disable all entities owned or contained by the parent entity. You can ignore the disabled field by using {@link access_show_hidden_entities()}.
См. также: ElggEntity::enable()
public disable ( string $reason = "", boolean $recursive = true ) : boolean
$reason string Optional reason
$recursive boolean Recursively disable all contained entities?
Результат boolean

disableAnnotations() публичный Метод

Disables annotations for this entity, optionally based on name.
С версии: 1.8
public disableAnnotations ( string $name = '' ) : boolean
$name string An options name of annotations to disable.
Результат boolean

disableMetadata() публичный Метод

Disables metadata for this entity, optionally based on name.
С версии: 1.8
public disableMetadata ( string $name = '' ) : boolean
$name string An options name of metadata to disable.
Результат boolean

enable() публичный Метод

Enable the entity
См. также: access_show_hiden_entities()
public enable ( boolean $recursive = true ) : boolean
$recursive boolean Recursively enable all entities disabled with the entity?
Результат boolean

enableAnnotations() публичный Метод

Enables annotations for this entity, optionally based on name.
С версии: 1.8
public enableAnnotations ( string $name = '' ) : boolean
$name string An options name of annotations to enable.
Результат boolean

enableMetadata() публичный Метод

Enables metadata for this entity, optionally based on name.
С версии: 1.8
public enableMetadata ( string $name = '' ) : boolean
$name string An options name of metadata to enable.
Результат boolean

getAccessID() публичный Метод

Returns the access_id.
public getAccessID ( ) : integer
Результат integer The access ID

getAnnotations() публичный Метод

To retrieve annotations on an unsaved entity, pass array('name' => [annotation name]) as the options array.
См. также: elgg_get_annotations()
public getAnnotations ( array $options = [] ) : array
$options array Array of options for elgg_get_annotations() except guid.
Результат array

getAnnotationsAvg() публичный Метод

Get the average of an integer type annotation.
public getAnnotationsAvg ( string $name ) : integer
$name string Annotation name
Результат integer

getAnnotationsMax() публичный Метод

Get the maximum of integer type annotations of a given name.
public getAnnotationsMax ( string $name ) : integer
$name string Annotation name
Результат integer

getAnnotationsMin() публичный Метод

Get the minimum of integer type annotations of given name.
public getAnnotationsMin ( string $name ) : integer
$name string Annotation name
Результат integer

getAnnotationsSum() публичный Метод

Get the sum of integer type annotations of a given name.
public getAnnotationsSum ( string $name ) : integer
$name string Annotation name
Результат integer

getContainerEntity() публичный Метод

Get the container entity for this object.
С версии: 1.8.0
public getContainerEntity ( ) : ElggEntity
Результат ElggEntity

getContainerGUID() публичный Метод

Gets the container GUID for this entity.
public getContainerGUID ( ) : integer
Результат integer

getDisplayName() абстрактный публичный Метод

Get the entity's display name
abstract public getDisplayName ( ) : string
Результат string The title or name of this entity.

getEntitiesFromRelationship() публичный Метод

Gets an array of entities with a relationship to this entity.
См. также: elgg_get_entities_from_relationship()
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.
Результат array | false An array of entities or false on failure

getGUID() публичный Метод

Returns the guid.
public getGUID ( ) : integer | null
Результат integer | null GUID

getIcon() публичный Метод

Returns entity icon as an ElggIcon object The icon file may or may not exist on filestore
public getIcon ( string $size, string $type = 'icon' ) : ElggIcon
$size string Size of the icon
$type string The name of the icon. e.g., 'icon', 'cover_photo'
Результат ElggIcon

getIconLastChange() публичный Метод

Returns the timestamp of when the icon was changed.
public getIconLastChange ( string $size, string $type = 'icon' ) : integer | null
$size string The size of the icon
$type string The name of the icon. e.g., 'icon', 'cover_photo'
Результат integer | null A unix timestamp of when the icon was last changed, or null if not set.

getIconURL() публичный Метод

Plugins can register for the 'entity:icon:url', plugin hook to customize the icon for an entity.
С версии: 1.8.0
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'
Результат string The URL

getLatitude() публичный Метод

Return the entity's latitude.
public getLatitude ( ) : float
Результат float

getLocation() публичный Метод

Gets the 'location' metadata for the entity
public getLocation ( ) : string
Результат string The location

getLongitude() публичный Метод

Return the entity's longitude
public getLongitude ( ) : float
Результат float

getMetadata() публичный Метод

Return the value of a piece of metadata.
public getMetadata ( string $name ) : mixed
$name string Name
Результат mixed The value, or null if not found.

getObjectFromID() публичный Метод

This is used by the system log. It can be called on any Loggable object.
public getObjectFromID ( integer $id ) : integer
$id integer GUID.
Результат integer GUID

getOriginalAttributes() публичный Метод

Get the original values of attribute(s) that have been modified since the entity was persisted.
public getOriginalAttributes ( ) : array
Результат array

getOwnerEntity() публичный Метод

Gets the \ElggEntity that owns this entity.
public getOwnerEntity ( ) : ElggEntity
Результат ElggEntity The owning entity

getOwnerGUID() публичный Метод

Get the guid of the entity's owner.
public getOwnerGUID ( ) : integer
Результат integer The owner GUID

getPrivateSetting() публичный Метод

Returns a private setting value
public getPrivateSetting ( string $name ) : mixed
$name string Name of the private setting
Результат mixed Null if the setting does not exist

getSubtype() публичный Метод

Get the entity subtype
public getSubtype ( ) : string
Результат string The entity subtype

getSystemLogID() публичный Метод

This id must be an integer.
public getSystemLogID ( ) : integer
Результат integer

getTags() публичный Метод

Returns tags for this entity.
public getTags ( array $tag_names = null ) : array
$tag_names array Optionally restrict by tag metadata names.
Результат array

getTimeUpdated() публичный Метод

Returns the UNIX epoch time that this entity was last updated
public getTimeUpdated ( ) : integer
Результат integer UNIX epoch time

getType() публичный Метод

Returns the entity type
public getType ( ) : string
Результат string The entity type

getURL() публичный Метод

Plugins can register for the 'entity:url', plugin hook to customize the url for an entity.
public getURL ( ) : string
Результат string The URL of the entity

getVolatileData() публичный Метод

Get a piece of volatile (non-persisted) data on this entity.
public getVolatileData ( string $name ) : mixed
$name string The name of the volatile data
Результат mixed The value or null if not found.

hasIcon() публичный Метод

Returns if the entity has an icon of the passed type.
public hasIcon ( string $size, string $type = 'icon' ) : boolean
$size string The size of the icon
$type string The name of the icon. e.g., 'icon', 'cover_photo'
Результат boolean

initializeAttributes() защищенный Метод

This is vital to distinguish between metadata and base parameters.
protected initializeAttributes ( ) : void
Результат void

isEnabled() публичный Метод

Is this entity enabled?
public isEnabled ( ) : boolean
Результат boolean Whether this entity is enabled.

isFullyLoaded() публичный Метод

Tests to see whether the object has been persisted.
public isFullyLoaded ( ) : boolean
Результат boolean

load() защищенный Метод

Loads attributes from the entities table into the object.
protected load ( mixed $guid ) : boolean
$guid mixed GUID of entity or \stdClass object from entities table
Результат boolean

loadAdditionalSelectValues() защищенный Метод

Stores non-attributes from the loading of the entity as volatile data
protected loadAdditionalSelectValues ( array $data ) : void
$data array Key value array
Результат void

prepareObject() защищенный Метод

Prepare an object copy for toObject()
protected prepareObject ( stdClass $object ) : stdClass
$object stdClass Object representation of the entity
Результат stdClass

refresh() публичный Метод

Load new data from database into existing entity. Overwrites data but does not change values not included in the latest data.
public refresh ( stdClass $row ) : boolean
$row stdClass DB row with new entity data
Результат boolean

removePrivateSetting() публичный Метод

Removes private setting
public removePrivateSetting ( string $name ) : boolean
$name string Name of the private setting
Результат boolean

removeRelationship() публичный Метод

Remove a relationship
См. также: ElggEntity::addRelationship()
См. также: ElggEntity::deleteRelationships()
public removeRelationship ( integer $guid_two, string $relationship ) : boolean
$guid_two integer GUID of the target entity of the relationship.
$relationship string The type of relationship.
Результат boolean

save() публичный Метод

Save an entity.
public save ( ) : boolean | integer
Результат boolean | integer

saveIconFromElggFile() публичный Метод

Saves icons using a file located in the data store as the source.
public saveIconFromElggFile ( ElggFile $file, string $type = 'icon', array $coords = [] ) : boolean
$file ElggFile An ElggFile instance
$type string The name of the icon. e.g., 'icon', 'cover_photo'
$coords array An array of cropping coordinates x1, y1, x2, y2
Результат boolean

saveIconFromLocalFile() публичный Метод

Saves icons using a local file as the source.
public saveIconFromLocalFile ( string $filename, string $type = 'icon', array $coords = [] ) : boolean
$filename string The full path to the local file
$type string The name of the icon. e.g., 'icon', 'cover_photo'
$coords array An array of cropping coordinates x1, y1, x2, y2
Результат boolean

saveIconFromUploadedFile() публичный Метод

Saves icons using an uploaded file as the source.
public saveIconFromUploadedFile ( string $input_name, string $type = 'icon', array $coords = [] ) : boolean
$input_name string Form input name
$type string The name of the icon. e.g., 'icon', 'cover_photo'
$coords array An array of cropping coordinates x1, y1, x2, y2
Результат boolean

setContainerGUID() публичный Метод

Set the container for this object.
public setContainerGUID ( integer $container_guid ) : boolean
$container_guid integer The ID of the container.
Результат boolean

setDisplayName() абстрактный публичный Метод

Sets the title or name of this entity.
abstract public setDisplayName ( string $displayName ) : void
$displayName string The title or name of this entity.
Результат void

setLatLong() публичный Метод

Set latitude and longitude metadata tags for a given entity.
public setLatLong ( float $lat, float $long ) : void
$lat float Latitude
$long float Longitude
Результат void

setLocation() публичный Метод

Sets the 'location' metadata for the entity
public setLocation ( string $location ) : void
$location string String representation of the location
Результат void

setMetadata() публичный Метод

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.
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
Результат boolean

setPrivateSetting() публичный Метод

Private settings are similar to metadata but will not be searched and there are fewer helper functions for them.
public setPrivateSetting ( string $name, mixed $value ) : boolean
$name string Name of private setting
$value mixed Value of private setting
Результат boolean

setVolatileData() публичный Метод

Set a piece of volatile (non-persisted) data on this entity
public setVolatileData ( string $name, mixed $value ) : void
$name string Name
$value mixed Value
Результат void

storeInPersistedCache() публичный Метод

Cache the entity in a persisted cache
public storeInPersistedCache ( ElggSharedMemoryCache $cache, integer $last_action ) : void
$cache ElggSharedMemoryCache Memcache or null cache
$last_action integer Last action time
Результат void

toObject() публичный Метод

public toObject ( )

update() защищенный Метод

Update the entity in the database.
protected update ( ) : boolean
Результат boolean Whether the update was successful.

updateLastAction() публичный Метод

Update the last_action column in the entities table.
public updateLastAction ( integer $posted = null ) : integer | false
$posted integer Timestamp of last action
Результат integer | false

Описание свойств

$orig_attributes защищенное свойство

Holds the original (persisted) attribute values that have been changed but not yet saved.
protected $orig_attributes

$temp_annotations защищенное свойство

Holds annotations until entity is saved. Once the entity is saved, annotations are written immediately to the database.
protected $temp_annotations

$temp_metadata защищенное свойство

Holds metadata until entity is saved. Once the entity is saved, metadata are written immediately to the database.
protected $temp_metadata

$temp_private_settings защищенное свойство

Holds private settings until entity is saved. Once the entity is saved, private settings are written immediately to the database.
protected $temp_private_settings

$url_override защищенное свойство

If set, overrides the value of getURL()
protected $url_override

$volatile защищенное свойство

Volatile data structure for this object, allows for storage of data in-memory that isn't sync'd back to the metadata table.
protected $volatile