16 protected $_profile_data = [];
45 $this->_profile_data = null;
48 $this->$profile_field_name =
$value;
60 if (empty($this->guid)) {
63 'annotation_name' =>
"profile:{$profile_field_name}",
70 if (empty($annotations)) {
74 if (!is_array($annotations)) {
75 $annotations = [$annotations];
104 if (!isset($this->_profile_data[$logged_in_user_guid])) {
108 return $qb->compare(
"{$main_alias}.name",
'LIKE',
'profile:%',
ELGG_VALUE_STRING);
114 if (!isset($profile_data[$annotation->name])) {
115 $profile_data[$annotation->name] = [];
121 $this->_profile_data[$logged_in_user_guid] = $profile_data;
124 return $this->_profile_data[$logged_in_user_guid];
138 $this->_profile_data = null;
getAllProfileAnnotations()
Returns all profile annotations.
setProfileData(string $profile_field_name, $value, int $access_id=ACCESS_PRIVATE)
Store profile data.
Database abstraction query builder.
deleteMetadata(string $name=null)
Deletes all metadata on this object (metadata.entity_guid = $this->guid).
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
annotate($name, $value, $access_id=ACCESS_PRIVATE, $owner_guid=0, $value_type= '')
Adds an annotation to an entity.
getProfileData(string $profile_field_name)
Get profile data.
deleteProfileData(string $profile_field_name)
Remove profile data.
getAnnotations(array $options=[])
Gets an array of annotations.
deleteAnnotations(string $name=null)
Deletes all annotations on this object (annotations.entity_guid = $this->guid).
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.