Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
MessageInterface Interface Reference
Inheritance diagram for MessageInterface:
AbstractMessage Error Notice Success TestingMessage Warning

Public Member Functions

 getType ()
 
 getText ()
 
 setText ($text)
 
 setIdentifier ($identifier)
 
 getIdentifier ()
 
 setIsSticky ($isSticky)
 
 getIsSticky ()
 
 toString ()
 
 setData (array $data=[])
 
 getData ()
 

Data Fields

const DEFAULT_IDENTIFIER = 'default_message_identifier'
 
const TYPE_ERROR = 'error'
 
const TYPE_WARNING = 'warning'
 
const TYPE_NOTICE = 'notice'
 
const TYPE_SUCCESS = 'success'
 

Detailed Description

Represent a message with a type, content text, and an isSticky attribute to prevent message from being cleared.

@api

Since
100.0.2

Definition at line 14 of file MessageInterface.php.

Member Function Documentation

◆ getData()

getData ( )

Returns message data

Returns
array

Implemented in AbstractMessage.

◆ getIdentifier()

getIdentifier ( )

Getter message identifier

Returns
string

Implemented in AbstractMessage.

◆ getIsSticky()

getIsSticky ( )

Getter for flag. Whether message is sticky

Returns
bool @SuppressWarnings(PHPMD.BooleanGetMethodName)

Implemented in AbstractMessage.

◆ getText()

getText ( )

Getter for text of message

Returns
string

Implemented in AbstractMessage.

◆ getType()

getType ( )

Getter message type

Returns
string

Implemented in AbstractMessage, TestingMessage, Error, Notice, Success, and Warning.

◆ setData()

setData ( array  $data = [])

Sets message data

Parameters
array$data
Returns
$this
Exceptions

Implemented in AbstractMessage.

◆ setIdentifier()

setIdentifier (   $identifier)

Setter message identifier

Parameters
string$identifier
Returns
$this

Implemented in AbstractMessage.

◆ setIsSticky()

setIsSticky (   $isSticky)

Setter for flag. Whether message is sticky

Parameters
bool$isSticky
Returns
$this

Implemented in AbstractMessage.

◆ setText()

setText (   $text)

Setter message text

Parameters
string$text
Returns
$this

Implemented in AbstractMessage.

◆ toString()

toString ( )

Retrieve message as a string

Returns
string

Implemented in AbstractMessage.

Field Documentation

◆ DEFAULT_IDENTIFIER

const DEFAULT_IDENTIFIER = 'default_message_identifier'

Default identifier

Definition at line 19 of file MessageInterface.php.

◆ TYPE_ERROR

const TYPE_ERROR = 'error'

Error type

Definition at line 24 of file MessageInterface.php.

◆ TYPE_NOTICE

const TYPE_NOTICE = 'notice'

Notice type

Definition at line 34 of file MessageInterface.php.

◆ TYPE_SUCCESS

const TYPE_SUCCESS = 'success'

Success type

Definition at line 39 of file MessageInterface.php.

◆ TYPE_WARNING

const TYPE_WARNING = 'warning'

Warning type

Definition at line 29 of file MessageInterface.php.


The documentation for this interface was generated from the following file: