Elgg  Version master
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | 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 ()
 
 delete ()
 Delete this relationship from the database. More...
 
 getURL ()
 Get a URL for this relationship. More...
 
 toObject (array $params=[])
 {} More...
 
 getSystemLogID ()
 {} More...
 
 getObjectFromID (int $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...
 
 getOriginalAttributes ()
 Get the original values of attribute(s) that have been modified since the relationship was persisted. 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...
 
 getSystemLogID ()
 Return an identification for the object for storage in the system log. More...
 
 getType ()
 Return the type of the object - eg. More...
 
 getSubtype ()
 Return a subtype. More...
 
 getObjectFromID (int $id)
 For a given ID, return the object associated with it. More...
 
 rewind ()
 Iterator interface. More...
 
 current ()
 Iterator interface. More...
 
 key ()
 Iterator interface. More...
 
 next ()
 Iterator interface. More...
 
 valid ()
 Iterator interface. More...
 
 offsetSet ($offset, $value)
 Array access interface. More...
 
 offsetGet ($offset)
 Array access interface. More...
 
 offsetUnset ($offset)
 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 ()
 Called during serialization. More...
 
 __unserialize (array $data)
 Called during unserialization. More...
 

Public Attributes

const PRIMARY_ATTR_NAMES
 

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...
 

Protected Attributes

const INTEGER_ATTR_NAMES
 
 $orig_attributes = []
 
- Protected Attributes inherited from ElggData
 $attributes = []
 
 $valid = false
 

Detailed Description

Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 12 of file ElggRelationship.php.

Constructor & Destructor Documentation

ElggRelationship::__construct ( \stdClass  $row)

Create a relationship object.

Parameters
\stdClass$rowDatabase row

Definition at line 46 of file ElggRelationship.php.

Member Function Documentation

ElggRelationship::__get (   $name)

Get an attribute of the relationship.

Parameters
string$nameName
Returns
mixed

Definition at line 121 of file ElggRelationship.php.

ElggRelationship::__set (   $name,
  $value 
)

Set an attribute of the relationship.

Parameters
string$nameName
mixed$valueValue
Returns
void

Definition at line 86 of file ElggRelationship.php.

ElggRelationship::delete ( )

Delete this relationship from the database.

Returns
bool

Definition at line 163 of file ElggRelationship.php.

ElggRelationship::getObjectFromID ( int  $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 215 of file ElggRelationship.php.

ElggRelationship::getOriginalAttributes ( )

Get the original values of attribute(s) that have been modified since the relationship was persisted.

Returns
array

Definition at line 243 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 234 of file ElggRelationship.php.

ElggRelationship::getSystemLogID ( )

{}

Definition at line 202 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 224 of file ElggRelationship.php.

ElggRelationship::getURL ( )

Get a URL for this relationship.

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

Returns
string

Definition at line 175 of file ElggRelationship.php.

ElggRelationship::initializeAttributes ( )
protected

(non-PHPdoc)

See also
::initializeAttributes()
Returns
void

Definition at line 70 of file ElggRelationship.php.

ElggRelationship::save ( )

Definition at line 132 of file ElggRelationship.php.

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

{}

Definition at line 184 of file ElggRelationship.php.

Member Data Documentation

ElggRelationship::$orig_attributes = []
protected

Definition at line 39 of file ElggRelationship.php.

const ElggRelationship::INTEGER_ATTR_NAMES
protected
Initial value:
= [
'guid_one',
'guid_two',
'time_created',
'id',
]

Definition at line 28 of file ElggRelationship.php.

const ElggRelationship::PRIMARY_ATTR_NAMES
Initial value:
= [
'id',
'guid_one',
'relationship',
'guid_two',
'time_created',
]

Definition at line 17 of file ElggRelationship.php.


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