PHP Класс HM\BackUpWordPress\Notices

Notices are messages along with an associated context, by default they are stored in the db and thus persist between page loads.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
clear_all_notices ( ) Clear all notices including persistent ones
get_instance ( ) : Notices Returns the *Singleton* instance of this class.
get_notices ( string $context = '' ) : array Fetch an array of notices messages
set_notices ( string $context, array $messages, boolean $persistent = true ) Set an array of notice messages for a specific context

Защищенные методы

Метод Описание
__construct ( ) Protected constructor to prevent creating a new instance of the *Singleton* via the new operator from outside of this class.

Приватные методы

Метод Описание
__clone ( ) Private clone method to prevent cloning of the instance of the *Singleton* instance.
__wakeup ( ) Private unserialize method to prevent unserializing of the *Singleton* instance.
get_all_notices ( ) : array Get both standard and persistent notices
get_persistent_notices ( ) : array Load the persistent notices from the database

Описание методов

__construct() защищенный Метод

Protected constructor to prevent creating a new instance of the *Singleton* via the new operator from outside of this class.
protected __construct ( )

clear_all_notices() публичный Метод

Clear all notices including persistent ones
public clear_all_notices ( )

get_instance() публичный статический Метод

Returns the *Singleton* instance of this class.
public static get_instance ( ) : Notices
Результат Notices The *Singleton* instance.

get_notices() публичный Метод

If you specify a context then you'll just get messages for that context otherwise you get multidimensional array of all contexts and their messages.
public get_notices ( string $context = '' ) : array
$context string The context that you'd like the messages for
Результат array The array of notice messages

set_notices() публичный Метод

Set an array of notice messages for a specific context
public set_notices ( string $context, array $messages, boolean $persistent = true )
$context string The context of the notice message
$messages array The array of messages
$persistent boolean Whether the notice should persist via the database. Defaults to true.