Elgg  Version 5.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ElggData Class Reference

A generic class that contains shared code among , , and . More...

Inheritance diagram for ElggData:
Elgg\Collections\CollectionItemInterface ElggAccessCollection ElggEntity ElggExtender ElggRelationship ElggGroup ElggObject ElggSite ElggUser ElggAnnotation ElggMetadata ElggAdminNotice ElggComment ElggFile ElggPlugin ElggUpgrade ElggWidget ElggIcon ElggTempFile

Public Member Functions

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

Protected Member Functions

 initializeAttributes ()
 Initialize the attributes array. More...
 
 getDatabase ()
 Provides a pointer to the database object. More...
 

Protected Attributes

 $attributes = []
 
 $valid = false
 

Detailed Description

A generic class that contains shared code among , , and .

Definition at line 10 of file ElggData.php.

Member Function Documentation

ElggData::__isset (   $name)

Test if property is set either as an attribute or metadata.

Use isset($entity->property)

Parameters
string$nameThe name of the attribute or metadata.
Returns
bool

Definition at line 56 of file ElggData.php.

ElggData::__serialize ( )

Called during serialization.

Returns
array
See also
serialize()
Since
4.1

Definition at line 310 of file ElggData.php.

ElggData::__unserialize ( array  $data)

Called during unserialization.

Parameters
array$dataserialized data
Returns
void
See also
unserialize()
Since
4.1

Definition at line 323 of file ElggData.php.

ElggData::__unset (   $name)

Unset a property from metadata or attribute.

Warning
If you use this to unset an attribute, you must save the object!
Parameters
string$nameThe name of the attribute or metadata.
Returns
void

Definition at line 69 of file ElggData.php.

ElggData::current ( )

Iterator interface.

See also
Iterator::current()
Returns
mixed

Definition at line 179 of file ElggData.php.

ElggData::delete ( )
abstract

Delete this data.

Returns
bool
ElggData::getDatabase ( )
protected

Provides a pointer to the database object.

Returns
The database where this data is (will be) stored.

Definition at line 43 of file ElggData.php.

ElggData::getID ( )

{Get unique item identifier within a collection.

Returns
string|int
}

Implements Elgg\Collections\CollectionItemInterface.

Definition at line 292 of file ElggData.php.

ElggData::getObjectFromID ( int  $id)
abstract

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$idGUID of an entity
Returns
static|false
ElggData::getPriority ( )

{Get priority (weight) of the item within a collection.

Returns
int
}

Implements Elgg\Collections\CollectionItemInterface.

Definition at line 299 of file ElggData.php.

ElggData::getSubtype ( )
abstract

Return a subtype.

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

Returns
string
ElggData::getSystemLogID ( )
abstract

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
ElggData::getTimeCreated ( )

Returns the UNIX epoch time that this entity was created.

Returns
int UNIX epoch time

Definition at line 99 of file ElggData.php.

ElggData::getType ( )
abstract

Return the type of the object - eg.

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

Returns
string
ElggData::getURL ( )
abstract

Get a URL for this object.

Returns
string
ElggData::initializeAttributes ( )
protected

Initialize the attributes array.

This is vital to distinguish between metadata and base parameters.

Returns
void

Definition at line 34 of file ElggData.php.

ElggData::key ( )

Iterator interface.

See also
Iterator::key()
Returns
string

Definition at line 191 of file ElggData.php.

ElggData::next ( )

Iterator interface.

See also
Iterator::next()
Returns
void

Definition at line 203 of file ElggData.php.

ElggData::offsetExists (   $offset)

Array access interface.

See also
::offsetExists()
Parameters
int$offsetAn offset to check for
Returns
bool

Definition at line 285 of file ElggData.php.

ElggData::offsetGet (   $offset)

Array access interface.

See also
::offsetGet()
Parameters
mixed$offsetThe offset to retrieve
Returns
mixed

Definition at line 250 of file ElggData.php.

ElggData::offsetSet (   $offset,
  $value 
)

Array access interface.

See also
::offsetSet()
Parameters
mixed$offsetThe offset to assign the value to
mixed$valueThe value to set
Returns
void

Definition at line 234 of file ElggData.php.

ElggData::offsetUnset (   $offset)

Array access interface.

See also
::offsetUnset()
Parameters
mixed$offsetThe offset to unset
Returns
void

Definition at line 268 of file ElggData.php.

ElggData::rewind ( )

Iterator interface.

See also
Iterator::rewind()
Returns
void

Definition at line 167 of file ElggData.php.

ElggData::save ( )
abstract

Save this data to the appropriate database table.

Returns
bool
ElggData::toObject ( array  $params = [])
abstract

Get a plain old object copy for public consumption.

Parameters
array$paramsExport parameters
Returns
bool is the iterator still ElggData::valid ( )

Iterator interface.

ITERATOR INTERFACE.

See also
Iterator::valid()
Returns
bool

Definition at line 215 of file ElggData.php.

Member Data Documentation

ElggData::$attributes = []
protected

Definition at line 25 of file ElggData.php.

ElggData::$valid = false
protected

Definition at line 157 of file ElggData.php.


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