PHP Class ElggObject, Elgg

Datei anzeigen Open project: elgg/elgg Class Usage Examples

Public Methods

Method Description
__construct ( stdClass $row = null ) Create a new \ElggObject.
canComment ( integer $user_guid, boolean $default = null ) : boolean Can a user comment on this object?
getDisplayName ( )
getExternalAttributes ( ) : array Get default values for attributes stored in a separate table
setDisplayName ( $displayName )

Protected Methods

Method Description
create ( )
initializeAttributes ( ) : void Initialize the attributes array to include the type, title, and description.
load ( mixed $guid ) : boolean Loads the full \ElggObject when given a guid.
prepareObject ( $object )
update ( )

Method Details

__construct() public method

Plugin developers should only use the constructor to create a new entity. To retrieve entities, use get_entity() and the elgg_get_entities* functions. If no arguments are passed, it creates a new entity. If a database result is passed as a \stdClass instance, it instantiates that entity.
public __construct ( stdClass $row = null )
$row stdClass Database row result. Default is null to create a new object.

canComment() public method

Can a user comment on this object?
See also: ElggEntity::canComment()
Since: 1.8.0
public canComment ( integer $user_guid, boolean $default = null ) : boolean
$user_guid integer User guid (default is logged in user)
$default boolean Default permission
return boolean

create() protected method

protected create ( )

getDisplayName() public method

public getDisplayName ( )

getExternalAttributes() final public static method

Get default values for attributes stored in a separate table
See also: Elgg\Database\EntityTable::getEntities
final public static getExternalAttributes ( ) : array
return array

initializeAttributes() protected method

Initialize the attributes array to include the type, title, and description.
protected initializeAttributes ( ) : void
return void

load() protected method

Loads the full \ElggObject when given a guid.
protected load ( mixed $guid ) : boolean
$guid mixed GUID of an \ElggObject or the \stdClass object from entities table
return boolean

prepareObject() protected method

protected prepareObject ( $object )

setDisplayName() public method

public setDisplayName ( $displayName )

update() protected method

protected update ( )