Elgg  Version 6.1
GroupSearchProfileFieldsHandler.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  $value = (array) $event->getValue();
20 
21  $defaults = [
22  'metadata' => [],
23  ];
24 
25  $value = array_merge($defaults, $value);
26 
27  $profile_fields = _elgg_services()->fields->get('group', 'group');
28  foreach ($profile_fields as $field) {
29  $value['metadata'][] = $field['name'];
30  }
31 
32  return $value;
33  }
34 }
$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
_elgg_services()
Get the global service provider.
Definition: elgglib.php:353
Models an event passed to event handlers.
Definition: Event.php:11
__invoke(\Elgg\Event $event)
Search through the group profile fields.