Elgg  Version master
Public Member Functions | Protected Member Functions | List of all members
ElggMetadata Class Reference

ElggMetadata. More...

Inheritance diagram for ElggMetadata:
ElggExtender ElggData Elgg\Collections\CollectionItemInterface

Public Member Functions

 __construct (?\stdClass $row=null)
 Constructor. More...
 
 canEdit (int $user_guid=0)
 Determines whether the user can edit this piece of metadata. More...
 
 save ()
 Save metadata object. More...
 
 delete ()
 Delete the metadata. More...
 
 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$idGUID of an entity
Returns
static|false
} More...
 
- Public Member Functions inherited from ElggExtender
 __set ($name, $value)
 Set an attribute. More...
 
 setValue ($value, string $value_type='')
 Set the value of the extender. More...
 
 __get ($name)
 Gets an attribute. More...
 
 getOwnerGUID ()
 Get the GUID of the extender's owner entity. More...
 
 getOwnerEntity ()
 Get the entity that owns this extender. More...
 
 getEntity ()
 Get the entity this describes. 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...
 
 getType ()
 Return a type of extension. More...
 
 getSubtype ()
 Return a subtype. More...
 
 getURL ()
 Get a url for this extender. 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...
 

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

Additional Inherited Members

- Static Public Member Functions inherited from ElggExtender
static detectValueType ($value, string $value_type='')
 Detect the value_type for a value to be stored as metadata or an annotation. More...
 
- Protected Attributes inherited from ElggExtender
const INTEGER_ATTR_NAMES
 
- Protected Attributes inherited from ElggData
 $attributes = []
 
 $valid = false
 

Detailed Description

ElggMetadata.

This class describes metadata that can be attached to an \ElggEntity. It is rare that a plugin developer needs to use this API for metadata. Almost all interaction with metadata occurs through the methods of \ElggEntity. See its __set(), __get(), and setMetadata() methods.

Definition at line 11 of file ElggMetadata.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
null | \stdClass$rowDatabase row

Definition at line 28 of file ElggMetadata.php.

Member Function Documentation

◆ canEdit()

ElggMetadata::canEdit ( int  $user_guid = 0)

Determines whether the user can edit this piece of metadata.

Parameters
int$user_guidThe GUID of the user (defaults to currently logged in user)
Returns
bool

Reimplemented from ElggExtender.

Definition at line 45 of file ElggMetadata.php.

◆ delete()

ElggMetadata::delete ( )

Delete the metadata.

Returns
bool

Reimplemented from ElggData.

Definition at line 67 of file ElggMetadata.php.

◆ getObjectFromID()

ElggMetadata::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$idGUID of an entity
Returns
static|false
}

Reimplemented from ElggData.

Definition at line 74 of file ElggMetadata.php.

◆ initializeAttributes()

ElggMetadata::initializeAttributes ( )
protected

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

Returns
void
}}

Reimplemented from ElggExtender.

Definition at line 16 of file ElggMetadata.php.

◆ save()

ElggMetadata::save ( )

Save metadata object.

Returns
bool

Reimplemented from ElggData.

Definition at line 54 of file ElggMetadata.php.


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