CRM_Utils_Check_Message
in package
Tags
Table of Contents
Properties
- $actions : array<string|int, mixed>
- $help : string
- $hiddenUntil : bool|string
- $icon : string
- $isVisible : bool
- $level : int
- $message : string
- $name : string
- $title : string
Methods
- __construct() : mixed
- Class constructor.
- addAction() : mixed
- Set optional additional actions text.
- addHelp() : mixed
- Set optional additional help text.
- getHiddenUntil() : string
- Get date hidden until.
- getLevel() : int
- Get severity level number.
- getMessage() : string
- Get message.
- getName() : string
- Get name.
- getSeverity() : string
- Get severity string.
- getTitle() : string
- isVisible() : bool
- Get message visibility.
- setLevel() : mixed
- Set severity level
- toArray() : array<string|int, mixed>
- Convert to array.
- checkStatusPreference() : bool
- Check if message has been hidden by the user.
Properties
$actions
private
array<string|int, mixed>
$actions
= []
actions which can be performed with this message
$help
private
string
$help
help text (to be presented separately from the message)
$hiddenUntil
private
bool|string
$hiddenUntil
Date this message is hidden until
$icon
private
string
$icon
crm-i css class
$isVisible
private
bool
$isVisible
Has this message been suppressed?
$level
private
int
$level
Tags
$message
private
string
$message
$name
private
string
$name
$title
private
string
$title
Methods
__construct()
Class constructor.
public
__construct(string $name, string $message, string $title[, string $level = PsrLogLogLevel::WARNING ][, string $icon = NULL ]) : mixed
Parameters
- $name : string
-
Symbolic name for the check.
- $message : string
-
Printable message (short or long).
- $title : string
-
Printable message (short).
- $level : string = PsrLogLogLevel::WARNING
-
The severity of the message. Use PSR-3 log levels.
- $icon : string = NULL
Tags
addAction()
Set optional additional actions text.
public
addAction(string $title, string|false $confirmation, string $type, array<string|int, mixed> $params[, string $icon = NULL ]) : mixed
Parameters
- $title : string
-
Text displayed on the status message as a link or button.
- $confirmation : string|false
-
Optional confirmation message before performing action
- $type : string
-
Link action type. One of: href|api3|api4
- $params : array<string|int, mixed>
-
Params to be passed to the api or CRM.url (depending on $type) Ex (api4): ['MyApiEntity', 'MyApiAction', [...apiParams...]] Ex (href): ['path' => 'civicrm/admin/foo', 'query' => 'reset=1'] Ex (href): ['url' => 'https://example.com/more/info']
- $icon : string = NULL
-
Fa-icon class for the button
addHelp()
Set optional additional help text.
public
addHelp(string $help) : mixed
Parameters
- $help : string
getHiddenUntil()
Get date hidden until.
public
getHiddenUntil() : string
Return values
stringgetLevel()
Get severity level number.
public
getLevel() : int
Tags
Return values
intgetMessage()
Get message.
public
getMessage() : string
Return values
stringgetName()
Get name.
public
getName() : string
Return values
stringgetSeverity()
Get severity string.
public
getSeverity() : string
Tags
Return values
stringgetTitle()
public
getTitle() : string
Return values
stringisVisible()
Get message visibility.
public
isVisible() : bool
Return values
boolsetLevel()
Set severity level
public
setLevel(string|int $level) : mixed
Parameters
- $level : string|int
Tags
toArray()
Convert to array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>checkStatusPreference()
Check if message has been hidden by the user.
private
checkStatusPreference() : bool
Also populates this->hiddenUntil property.
Tags
Return values
bool —TRUE means hidden, FALSE means visible.