PHP Class ElggAnnotation, Elgg

Annotations allow you to attach bits of information to entities. They are essentially the same as metadata, but with additional helper functions for performing calculations.
Inheritance: extends ElggExtender
Mostra file Open project: elgg/elgg Class Usage Examples

Public Methods

Method Description
__construct ( stdClass $row = null ) Construct a new annotation object
canEdit ( integer $user_guid ) : boolean Determines whether or not the user can edit this annotation
delete ( ) : boolean Delete the annotation.
disable ( ) : boolean Disable the annotation.
enable ( ) : boolean Enable the annotation.
getObjectFromID ( integer $id ) : ElggAnnotation For a given ID, return the object associated with it.
save ( ) : integer Save this instance

Protected Methods

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

Method Details

__construct() public method

Plugin developers will probably never use the constructor. See \ElggEntity for its API for adding annotations.
public __construct ( stdClass $row = null )
$row stdClass Database row as \stdClass object

canEdit() public method

Determines whether or not the user can edit this annotation
See also: elgg_set_ignore_access()
public canEdit ( integer $user_guid ) : boolean
$user_guid integer The GUID of the user (defaults to currently logged in user)
return boolean

delete() public method

Delete the annotation.
public delete ( ) : boolean
return boolean

disable() public method

Disable the annotation.
Since: 1.8
public disable ( ) : boolean
return boolean

enable() public method

Enable the annotation.
Since: 1.8
public enable ( ) : boolean
return boolean

getObjectFromID() public method

This is used by the river functionality primarily. This is useful for checking access permissions etc on objects.
public getObjectFromID ( integer $id ) : ElggAnnotation
$id integer An annotation ID.
return ElggAnnotation

initializeAttributes() protected method

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

save() public method

Save this instance
public save ( ) : integer
return integer an object id