16 protected $_profile_data = [];
42 $this->annotate(
"profile:{$profile_field_name}", $v,
$access_id, $this->guid);
45 $this->_profile_data = null;
48 $this->$profile_field_name =
$value;
60 if (empty($this->guid)) {
62 $annotations = $this->getAnnotations([
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])) {
105 $annotations = $this->getAnnotations([
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];
135 $result = $this->deleteAnnotations(
"profile:{$profile_field_name}");
136 $result &= $this->deleteMetadata($profile_field_name);
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.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
getProfileData(string $profile_field_name)
Get profile data.
deleteProfileData(string $profile_field_name)
Remove profile data.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.