Elgg  Version 4.3
GroupSearchProfileFieldsHandler.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Search;
4 
5 use Elgg\Hook;
6 
12 
22  public function __invoke(Hook $hook) {
23  $value = (array) $hook->getValue();
24 
25  $defaults = [
26  'metadata' => [],
27  ];
28 
29  $value = array_merge($defaults, $value);
30 
31  $profile_fields = _elgg_services()->fields->get('group', 'group');
32  foreach ($profile_fields as $field) {
33  $value['metadata'][] = $field['name'];
34  }
35 
36  return $value;
37  }
38 }
$defaults
$value
Definition: generic.php:51
getValue()
Get the current value of the hook.
Models an event passed to hook handlers.
Definition: Hook.php:11
__invoke(Hook $hook)
Search through the group profile fields.
if(elgg_extract('required', $vars)) if(elgg_extract('disabled', $vars)) $field
Definition: field.php:37
_elgg_services()
Get the global service provider.
Definition: elgglib.php:638