PHP Class ElggExtender, Elgg

Extenders allow you to attach extended information to an ElggEntity. Core supports two: ElggAnnotation, ElggMetadata, and ElggRelationship Saving the extender data to database is handled by the child class.
See also: ElggAnnotation
See also: ElggMetadata
Inheritance: extends ElggData
Mostrar archivo Open project: elgg/elgg Class Usage Examples

Public Methods

Method Description
__get ( string $name ) : mixed Gets an attribute
__set ( string $name, mixed $value ) : void Set an attribute
canEdit ( integer $user_guid ) : boolean Returns if a user can edit this entity extender.
getEntity ( ) : ElggEntity Get the entity this describes.
getOwnerEntity ( ) : ElggEntity Get the entity that owns this extender
getOwnerGUID ( ) : integer Get the GUID of the extender's owner entity.
getSubtype ( ) : string Return a subtype. For metadata & annotations this is the 'name' and for relationship this is the relationship type.
getSystemLogID ( ) : integer Return an identification for the object for storage in the system log.
getType ( ) : string Return a type of extension.
getURL ( ) : string Get a url for this extender.
setValue ( mixed $value, string $value_type = '' ) : void Set the value of the extender
toObject ( )

Protected Methods

Method Description
initializeAttributes ( ) : void (non-PHPdoc)

Method Details

__get() public method

Gets an attribute
public __get ( string $name ) : mixed
$name string Name
return mixed

__set() public method

Set an attribute
public __set ( string $name, mixed $value ) : void
$name string Name
$value mixed Value
return void

canEdit() abstract public method

Returns if a user can edit this entity extender.
See also: elgg_set_ignore_access()
abstract public canEdit ( integer $user_guid ) : boolean
$user_guid integer The GUID of the user doing the editing (defaults to currently logged in user)
return boolean

getEntity() public method

Get the entity this describes.
public getEntity ( ) : ElggEntity
return ElggEntity The entity

getOwnerEntity() public method

Get the entity that owns this extender
public getOwnerEntity ( ) : ElggEntity
return ElggEntity

getOwnerGUID() public method

Get the GUID of the extender's owner entity.
public getOwnerGUID ( ) : integer
return integer The owner GUID

getSubtype() public method

Return a subtype. For metadata & annotations this is the 'name' and for relationship this is the relationship type.
public getSubtype ( ) : string
return string

getSystemLogID() public method

This id must be an integer.
public getSystemLogID ( ) : integer
return integer

getType() public method

Return a type of extension.
public getType ( ) : string
return string

getURL() public method

Plugins can register for the 'extender:url', plugin hook to customize the url for an annotation or metadata.
public getURL ( ) : string
return string

initializeAttributes() protected method

(non-PHPdoc)
See also: ElggData::initializeAttributes()
protected initializeAttributes ( ) : void
return void

setValue() public method

Set the value of the extender
Since: 1.9
public setValue ( mixed $value, string $value_type = '' ) : void
$value mixed The value being set
$value_type string The type of the : 'integer' or 'text'
return void

toObject() public method

public toObject ( )