Elgg  Version 6.2
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=null)
 Create a relationship object. More...
 
 __set (string $name, mixed $value)
 Set an attribute of the relationship. More...
 
 __get (string $name)
 Get an attribute of the relationship. More...
 
 save ()
 {Save this data to the appropriate database table.
Returns
bool
} More...
 
 delete ()
 Delete this relationship from the database. More...
 
 getURL ()
 Get a URL for this relationship. More...
 
 toObject (array $params=[])
 {Get a plain old object copy for public consumption.
Parameters
array$paramsExport parameters
Returns
\Elgg\Export\Data
} More...
 
 getSystemLogID ()
 {Return an identification for the object for storage in the system log.This id must be an integer. Unsaved implementations should return 0.
Returns
int
} 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...
 
 getTimeCreated ()
 Returns the UNIX epoch time that this entity was created. 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 ()
 {Initialize the attributes array.This is vital to distinguish between metadata and base parameters.
Returns
void
} More...
 
- Protected Member Functions inherited from ElggData
 getDatabase ()
 Provides a pointer to the database object. More...
 

Protected Attributes

const INTEGER_ATTR_NAMES
 
array $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

◆ __construct()

ElggRelationship::__construct ( ?\stdClass  $row = null)

Create a relationship object.

Parameters
null | \stdClass$rowDatabase row

Definition at line 46 of file ElggRelationship.php.

Member Function Documentation

◆ __get()

ElggRelationship::__get ( string  $name)

Get an attribute of the relationship.

Parameters
string$nameName
Returns
mixed

Definition at line 121 of file ElggRelationship.php.

◆ __set()

ElggRelationship::__set ( string  $name,
mixed  $value 
)

Set an attribute of the relationship.

Parameters
string$nameName
mixed$valueValue
Returns
void

Definition at line 85 of file ElggRelationship.php.

◆ delete()

ElggRelationship::delete ( )

Delete this relationship from the database.

Returns
bool

Reimplemented from ElggData.

Definition at line 158 of file ElggRelationship.php.

◆ getObjectFromID()

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
\ElggRelationship|false

Reimplemented from ElggData.

Definition at line 210 of file ElggRelationship.php.

◆ getOriginalAttributes()

ElggRelationship::getOriginalAttributes ( )

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

Returns
array

Definition at line 238 of file ElggRelationship.php.

◆ getSubtype()

ElggRelationship::getSubtype ( )

Return a subtype.

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

Returns
string

Reimplemented from ElggData.

Definition at line 229 of file ElggRelationship.php.

◆ getSystemLogID()

ElggRelationship::getSystemLogID ( )

{Return an identification for the object for storage in the system log.This id must be an integer. Unsaved implementations should return 0.

Returns
int
}

Reimplemented from ElggData.

Definition at line 197 of file ElggRelationship.php.

◆ getType()

ElggRelationship::getType ( )

Return a type of the object - eg.

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

Returns
string 'relationship'

Reimplemented from ElggData.

Definition at line 219 of file ElggRelationship.php.

◆ getURL()

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

Reimplemented from ElggData.

Definition at line 170 of file ElggRelationship.php.

◆ initializeAttributes()

ElggRelationship::initializeAttributes ( )
protected

{Initialize the attributes array.This is vital to distinguish between metadata and base parameters.

Returns
void
}

Reimplemented from ElggData.

Definition at line 68 of file ElggRelationship.php.

◆ save()

ElggRelationship::save ( )

{Save this data to the appropriate database table.

Returns
bool
}

Reimplemented from ElggData.

Definition at line 132 of file ElggRelationship.php.

◆ toObject()

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

{Get a plain old object copy for public consumption.

Parameters
array$paramsExport parameters
Returns
\Elgg\Export\Data
}

Reimplemented from ElggData.

Definition at line 179 of file ElggRelationship.php.

Member Data Documentation

◆ $orig_attributes

array ElggRelationship::$orig_attributes = []
protected

Definition at line 39 of file ElggRelationship.php.

◆ INTEGER_ATTR_NAMES

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

Definition at line 28 of file ElggRelationship.php.

◆ PRIMARY_ATTR_NAMES

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: