Elgg  Version 6.1
UserSearchProfileFieldsHandler.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Search;
4 
10 
18  public function __invoke(\Elgg\Event $event) {
19 
20  $value = (array) $event->getValue();
21 
22  $defaults = [
23  'annotations' => [],
24  ];
25 
26  $value = array_merge($defaults, $value);
27 
28  $profile_fields = _elgg_services()->fields->get('user', 'user');
29  foreach ($profile_fields as $field) {
30  $value['annotations'][] = "profile:{$field['name']}";
31  }
32 
33  return $value;
34  }
35 }
$defaults
Generic entity header upload helper.
Definition: header.php:6
if(elgg_extract('input_type', $vars)) if(elgg_extract('required', $vars)) if(elgg_extract('disabled', $vars)) $field
Definition: field.php:42
$value
Definition: generic.php:51
__invoke(\Elgg\Event $event)
Search through the user profile fields.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:353
Models an event passed to event handlers.
Definition: Event.php:11