Elgg  Version 6.1
GroupSearchFieldsHandler.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  'metadata' => [],
24  ];
25 
26  $value = array_merge($defaults, $value);
27 
28  $fields = [
29  'name',
30  'description',
31  ];
32 
33  $value['metadata'] = array_merge($value['metadata'], $fields);
34 
35  return $value;
36  }
37 }
$defaults
Generic entity header upload helper.
Definition: header.php:6
$value
Definition: generic.php:51
$fields
Save the configuration of the security.txt contents.
Definition: security_txt.php:6
__invoke(\Elgg\Event $event)
Populate default search fields for group entities.
Models an event passed to event handlers.
Definition: Event.php:11