Elgg  Version 3.0
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
ElggRelationship Class Reference
Inheritance diagram for ElggRelationship:
ElggData Elgg\Collections\CollectionItemInterface

Public Member Functions

 __construct (\stdClass $row)
 Create a relationship object. More...
 
 __set ($name, $value)
 Set an attribute of the relationship. More...
 
 __get ($name)
 Get an attribute of the relationship. More...
 
 save ()
 Save the relationship. More...
 
 delete ()
 Delete this relationship from the database. More...
 
 getURL ()
 Get a URL for this relationship. More...
 
 toObject (array $params=[])
 {} More...
 
 getSystemLogID ()
 Return an identification for the object for storage in the system log. More...
 
 getObjectFromID ($id)
 For a given ID, return the object associated with it. More...
 
 getType ()
 Return a type of the object - eg. More...
 
 getSubtype ()
 Return a subtype. More...
 
- Public Member Functions inherited from ElggData
 __isset ($name)
 Test if property is set either as an attribute or metadata. More...
 
 __unset ($name)
 Unset a property from metadata or attribute. More...
 
 getURL ()
 Get a URL for this object. More...
 
 save ()
 Save this data to the appropriate database table. More...
 
 delete ()
 Delete this data. More...
 
 getTimeCreated ()
 Returns the UNIX epoch time that this entity was created. More...
 
 toObject (array $params=[])
 Get a plain old object copy for public consumption. More...
 
 rewind ()
 Iterator interface. More...
 
 current ()
 Iterator interface. More...
 
 key ()
 Iterator interface. More...
 
 next ()
 Iterator interface. More...
 
 valid ()
 Iterator interface. More...
 
 offsetSet ($key, $value)
 Array access interface. More...
 
 offsetGet ($key)
 Array access interface. More...
 
 offsetUnset ($key)
 Array access interface. More...
 
 offsetExists ($offset)
 Array access interface. More...
 
 getId ()
 {Get unique item identifier within a collection.
Returns
string|int
} More...
 
 getPriority ()
 {Get priority (weight) of the item within a collection.
Returns
int
} More...
 
 serialize ()
 {} More...
 
 unserialize ($serialized)
 {} More...
 

Public Attributes

const RELATIONSHIP_LIMIT = 50
 

Protected Member Functions

 initializeAttributes ()
 (non-PHPdoc) More...
 
- Protected Member Functions inherited from ElggData
 initializeAttributes ()
 Initialize the attributes array. More...
 
 getDatabase ()
 Provides a pointer to the database object. More...
 

Additional Inherited Members

- Protected Attributes inherited from ElggData
 $attributes = []
 The main attributes of an entity. More...
 
 $valid = false
 

Detailed Description

Definition at line 14 of file ElggRelationship.php.

Constructor & Destructor Documentation

ElggRelationship::__construct ( \stdClass  $row)

Create a relationship object.

Parameters
\stdClass$rowDatabase row
Exceptions
InvalidArgumentException

Definition at line 24 of file ElggRelationship.php.

Member Function Documentation

ElggRelationship::__get (   $name)

Get an attribute of the relationship.

Parameters
string$nameName
Returns
mixed

Definition at line 67 of file ElggRelationship.php.

ElggRelationship::__set (   $name,
  $value 
)

Set an attribute of the relationship.

Parameters
string$nameName
mixed$valueValue
Returns
void

Definition at line 57 of file ElggRelationship.php.

ElggRelationship::delete ( )

Delete this relationship from the database.

Returns
bool

Definition at line 106 of file ElggRelationship.php.

ElggRelationship::getObjectFromID (   $id)

For a given ID, return the object associated with it.

This is used by the river functionality primarily. This is useful for checking access permissions etc on objects.

Parameters
int$idID
Returns
|false

Definition at line 187 of file ElggRelationship.php.

ElggRelationship::getSubtype ( )

Return a subtype.

For metadata & annotations this is the 'name' and for relationship this is the relationship type.

Returns
string

Definition at line 206 of file ElggRelationship.php.

ElggRelationship::getSystemLogID ( )

Return an identification for the object for storage in the system log.

This id must be an integer.

Returns
int

Definition at line 174 of file ElggRelationship.php.

ElggRelationship::getType ( )

Return a type of the object - eg.

object, group, user, relationship, metadata, annotation etc

Returns
string 'relationship'

Definition at line 196 of file ElggRelationship.php.

ElggRelationship::getURL ( )

Get a URL for this relationship.

Plugins can register for the 'relationship:url', 'relationship' plugin hook to customize the url for a relationship.

Returns
string

Definition at line 118 of file ElggRelationship.php.

ElggRelationship::initializeAttributes ( )
protected

(non-PHPdoc)

See also
::initializeAttributes()
Returns
void

Definition at line 41 of file ElggRelationship.php.

ElggRelationship::save ( )

Save the relationship.

Returns
int the relationship ID
Exceptions
IOException

Definition at line 81 of file ElggRelationship.php.

ElggRelationship::toObject ( array  $params = [])

{}

Definition at line 153 of file ElggRelationship.php.

Member Data Documentation

const ElggRelationship::RELATIONSHIP_LIMIT = 50

Definition at line 16 of file ElggRelationship.php.


The documentation for this class was generated from the following file: