PHP Class ElggRelationship, Elgg

Inheritance: extends ElggData, implements Importable
Exibir arquivo Open project: elgg/elgg Class Usage Examples

Public Methods

Method Description
__construct ( stdClass $row ) Create a relationship object
__get ( string $name ) : mixed Get an attribute of the relationship
__set ( string $name, mixed $value ) : void Set an attribute of the relationship
delete ( ) : boolean Delete this relationship from the database.
getObjectFromID ( integer $id ) : ElggRelationship For a given ID, return the object associated with it.
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 the object - eg. object, group, user, relationship, metadata, annotation etc
getURL ( ) : string Get a URL for this relationship.
save ( ) : integer Save the relationship
toObject ( )

Protected Methods

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

Method Details

__construct() public method

Create a relationship object
public __construct ( stdClass $row )
$row stdClass Database row

__get() public method

Get an attribute of the relationship
public __get ( string $name ) : mixed
$name string Name
return mixed

__set() public method

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

delete() public method

Delete this relationship from the database.
public delete ( ) : 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 ) : ElggRelationship
$id integer ID
return ElggRelationship

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 the object - eg. object, group, user, relationship, metadata, annotation etc
public getType ( ) : string
return string 'relationship'

getURL() public method

Plugins can register for the 'relationship:url', 'relationship' plugin hook to customize the url for a relationship.
public getURL ( ) : string
return string

initializeAttributes() protected method

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

save() public method

Save the relationship
public save ( ) : integer
return integer the relationship ID

toObject() public method

public toObject ( )