Documentation

CRM_Utils_Check_Message
in package

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

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
see
LogLevel

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
see
LogLevel

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
string

getLevel()

Get severity level number.

public getLevel() : int
Tags
see
LogLevel
Return values
int

getMessage()

Get message.

public getMessage() : string
Return values
string

getName()

Get name.

public getName() : string
Return values
string

getSeverity()

Get severity string.

public getSeverity() : string
Tags
see
LogLevel
Return values
string

getTitle()

public getTitle() : string
Return values
string

isVisible()

Get message visibility.

public isVisible() : bool
Return values
bool

setLevel()

Set severity level

public setLevel(string|int $level) : mixed
Parameters
$level : string|int
Tags
throws
CRM_Core_Exception

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
throws
CRM_Core_Exception
Return values
bool

TRUE means hidden, FALSE means visible.


        
On this page

Search results