Elgg  Version 6.3
deprecated-6.3.php
Go to the documentation of this file.
1 <?php
19 function elgg_dump($value): void {
20  elgg_deprecated_notice(__METHOD__ . ' has been deprecated, use elgg_log()', '6.3');
21 
22  _elgg_services()->logger->error($value);
23 }
24 
50 function notify_user(int|array $to, int $from = 0, string $subject = '', string $message = '', array $params = [], $methods_override = null): array {
51  elgg_deprecated_notice(__METHOD__ . ' has been deprecated use "elgg_notify_user()"', '6.3');
52 
53  $params['subject'] = $subject;
54  $params['body'] = $message;
55  $params['methods_override'] = $methods_override ? (array) $methods_override : null;
56 
57  if (!empty($from)) {
58  $sender = get_entity($from);
59  } else {
60  $sender = elgg_get_site_entity();
61  }
62 
63  if (!$sender instanceof \ElggEntity) {
64  return [];
65  }
66 
67  $recipients = [];
68  $to = (array) $to;
69  foreach ($to as $guid) {
71  if (!$recipient instanceof \ElggEntity) {
72  continue;
73  }
74 
75  $recipients[] = $recipient;
76  }
77 
78  return _elgg_services()->notifications->sendInstantNotifications($sender, $recipients, $params);
79 }
$guid
Reset an ElggUpgrade.
Definition: reset.php:6
$recipient
Definition: mute.php:8
$params
Saves global plugin settings.
Definition: save.php:13
$subject
HTML body of an email.
Definition: body.php:11
notify_user(int|array $to, int $from=0, string $subject='', string $message='', array $params=[], $methods_override=null)
Notify a user via their preferences.
elgg_dump($value)
Bundle all functions that have been deprecated in Elgg 6.3.
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:101
_elgg_services()
Get the global service provider.
Definition: elgglib.php:337
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:68
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:99
$value
Definition: generic.php:51