Elgg  Version 5.1
ObjectSearchFieldsHandler.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  'title',
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 object entities.
Models an event passed to event handlers.
Definition: Event.php:11