Elgg
Version master
|
Functions | |
deleteAnnotations (string $name=null) | |
Deletes all annotations on this object (annotations.entity_guid = $this->guid). More... | |
deleteOwnedAnnotations (string $name=null) | |
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid). More... | |
annotate ($name, $value, $access_id=ACCESS_PRIVATE, $owner_guid=0, $value_type= '') | |
Adds an annotation to an entity. More... | |
getAnnotations (array $options=[]) | |
Gets an array of annotations. More... | |
countAnnotations (string $name= '') | |
Count annotations. More... | |
getAnnotationsAvg (string $name) | |
Get the average of an integer type annotation. More... | |
getAnnotationsSum (string $name) | |
Get the sum of integer type annotations of a given name. More... | |
getAnnotationsMin (string $name) | |
Get the minimum of integer type annotations of given name. More... | |
getAnnotationsMax (string $name) | |
Get the maximum of integer type annotations of a given name. More... | |
getMetadata (string $name) | |
Return the value of a piece of metadata. More... | |
getAllMetadata () | |
Get all entity metadata. More... | |
setMetadata (string $name, mixed $value, string $value_type= '', bool $multiple=false) | |
Set metadata on this entity. More... | |
setTempMetadata (string $name, mixed $value, bool $multiple=false) | |
Set temp metadata on this entity. More... | |
deleteMetadata (string $name=null) | |
Deletes all metadata on this object (metadata.entity_guid = $this->guid). More... | |
setProfileData (string $profile_field_name, $value, int $access_id=ACCESS_PRIVATE) | |
Store profile data. More... | |
getProfileData (string $profile_field_name) | |
Get profile data. More... | |
getAllProfileAnnotations () | |
Returns all profile annotations. More... | |
deleteProfileData (string $profile_field_name) | |
Remove profile data. More... | |
Variables | |
trait | Annotations |
Bundle all annotations related functions for an . More... | |
trait | Metadata |
Bundle all metadata related functions for an . More... | |
trait | ProfileData |
Adds methods to save profile data to an ElggEntity. More... | |
Elgg\Traits\Entity\annotate | ( | $name, | |
$value, | |||
$access_id = ACCESS_PRIVATE , |
|||
$owner_guid = 0 , |
|||
$value_type = '' |
|||
) |
Adds an annotation to an entity.
string | $name | Annotation name |
mixed | $value | Annotation value |
int | $access_id | Access ID |
int | $owner_guid | GUID of the annotation owner |
string | $value_type | The type of annotation value |
Definition at line 106 of file Annotations.php.
Elgg\Traits\Entity\countAnnotations | ( | string | $name = '' | ) |
Count annotations.
string | $name | The type of annotation. |
Definition at line 168 of file Annotations.php.
Elgg\Traits\Entity\deleteAnnotations | ( | string | $name = null | ) |
Deletes all annotations on this object (annotations.entity_guid = $this->guid).
If you pass a name, only annotations matching that name will be deleted.
string | null | $name | An optional name of annotations to remove. |
Definition at line 31 of file Annotations.php.
Elgg\Traits\Entity\deleteMetadata | ( | string | $name = null | ) |
Deletes all metadata on this object (metadata.entity_guid = $this->guid).
If you pass a name, only metadata matching that name will be deleted.
null | string | $name | The name of the metadata to remove. |
Definition at line 198 of file Metadata.php.
Elgg\Traits\Entity\deleteOwnedAnnotations | ( | string | $name = null | ) |
Deletes all annotations owned by this object (annotations.owner_guid = $this->guid).
If you pass a name, only annotations matching that name will be deleted.
string | null | $name | An optional name of annotations to delete. |
Definition at line 58 of file Annotations.php.
Elgg\Traits\Entity\deleteProfileData | ( | string | $profile_field_name | ) |
Remove profile data.
string | $profile_field_name | the profile field name to remove |
Definition at line 134 of file ProfileData.php.
Elgg\Traits\Entity\getAllMetadata | ( | ) |
|
protected |
Elgg\Traits\Entity\getAnnotations | ( | array | $options = [] | ) |
Gets an array of annotations.
To retrieve annotations on an unsaved entity, pass array('name' => [annotation name]) as the options array.
array | $options | Array of options for elgg_get_annotations() except guid. |
Definition at line 145 of file Annotations.php.
Elgg\Traits\Entity\getAnnotationsAvg | ( | string | $name | ) |
Get the average of an integer type annotation.
string | $name | Annotation name |
Definition at line 179 of file Annotations.php.
Elgg\Traits\Entity\getAnnotationsMax | ( | string | $name | ) |
Get the maximum of integer type annotations of a given name.
string | $name | Annotation name |
Definition at line 212 of file Annotations.php.
Elgg\Traits\Entity\getAnnotationsMin | ( | string | $name | ) |
Get the minimum of integer type annotations of given name.
string | $name | Annotation name |
Definition at line 201 of file Annotations.php.
Elgg\Traits\Entity\getAnnotationsSum | ( | string | $name | ) |
Get the sum of integer type annotations of a given name.
string | $name | Annotation name |
Definition at line 190 of file Annotations.php.
Elgg\Traits\Entity\getMetadata | ( | string | $name | ) |
Return the value of a piece of metadata.
string | $name | Name |
Definition at line 27 of file Metadata.php.
Elgg\Traits\Entity\getProfileData | ( | string | $profile_field_name | ) |
Get profile data.
string | $profile_field_name | profile field name |
Definition at line 58 of file ProfileData.php.
Elgg\Traits\Entity\setMetadata | ( | string | $name, |
mixed | $value, | ||
string | $value_type = '' , |
||
bool | $multiple = false |
||
) |
Set metadata on this entity.
Plugin developers usually want to use the magic set method ($entity->name = 'value'). Use this method if you want to explicitly set the owner or access of the metadata. You cannot set the owner/access before the entity has been saved.
string | $name | Name of the metadata |
mixed | $value | Value of the metadata (doesn't support assoc arrays) |
string | $value_type | 'text', 'integer', or '' for automatic detection |
bool | $multiple | Allow multiple values for a single name. Does not support associative arrays. |
Definition at line 78 of file Metadata.php.
Elgg\Traits\Entity\setProfileData | ( | string | $profile_field_name, |
$value, | |||
int | $access_id = ACCESS_PRIVATE |
||
) |
Store profile data.
string | $profile_field_name | profile field name |
mixed | $value | profile data |
int | $access_id | access of the profile data |
Definition at line 27 of file ProfileData.php.
|
protected |
Set temp metadata on this entity.
string | $name | Name of the metadata |
mixed | $value | Value of the metadata (doesn't support assoc arrays) |
bool | $multiple | Allow multiple values for a single name. Does not support associative arrays. |
Definition at line 166 of file Metadata.php.
trait Elgg::Traits::Entity\Annotations |
Bundle all annotations related functions for an .
Definition at line 10 of file Annotations.php.
trait Elgg::Traits::Entity\Metadata |
Bundle all metadata related functions for an .
Definition at line 10 of file Metadata.php.
trait Elgg::Traits::Entity\ProfileData |
Adds methods to save profile data to an ElggEntity.
Data is stored in Annotations (and Metadata for BC reasons)
Definition at line 11 of file ProfileData.php.