29 if (!$id || !$message) {
37 $admin_notice = new \ElggAdminNotice();
38 $admin_notice->admin_notice_id =
$id;
39 $admin_notice->description =
$message;
43 return $admin_notice->save();
46 return $result ? $admin_notice :
false;
56 public function delete(
string $id =
'') {
61 'metadata_name' =>
'admin_notice_id',
62 'metadata_value' => $id,
65 'batch_inc_offset' =>
false,
87 'subtype' =>
'admin_notice',
105 'subtype' =>
'admin_notice',
106 'metadata_name_value_pair' => [
'name' =>
'admin_notice_id',
'value' => $id],
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
elgg_admin_notice_exists(string $id)
Check if an admin notice is currently active.
static find(array $options=[])
Build and execute a new query from an array of legacy options.
add(string $id, string $message)
Write a persistent message to the admin view.
const ELGG_IGNORE_ACCESS
elgg_call() flags
elgg_count_entities(array $options=[])
Returns a count of entities.
exists(string $id)
Check if an admin notice is currently active.
find(array $options=[])
Get admin notices.
$id
Generic annotation delete action.
Controls all admin notices in the system.