Mage_Core_Model_Message_Abstract
in package
Table of Contents
Properties
- $_class : mixed
- $_code : mixed
- $_identifier : mixed
- $_isSticky : mixed
- $_method : mixed
- $_textArgs : array<int, string|Link|null>|null
- $_type : mixed
Methods
- __construct() : mixed
- Mage_Core_Model_Message_Abstract constructor.
- formatText() : string
- Replace each %s placeholder in $text with one argument. $renderArg converts each argument to a string first. All renderers use this method, so the plain text and the HTML get the same values. If $text does not match the arguments, this method calls $onError and returns $text unchanged. A bad message does not stop the page.
- getCode() : string
- getIdentifier() : mixed
- Get message identifier
- getIsSticky() : bool
- Get whether message is sticky
- getText() : string
- Get the plain text of the message. Each %s placeholder is replaced with its argument.
- getTextArgs() : array<int, string|Link|null>|null
- getType() : string
- setClass() : $this
- setCode() : Mage_Core_Model_Message_Abstract
- Set code
- setIdentifier() : Mage_Core_Model_Message_Abstract
- Set message identifier
- setIsSticky() : Mage_Core_Model_Message_Abstract
- Set message sticky status
- setMethod() : $this
- setTextArgs() : static
- Set the values for the %s placeholders in the message text.
- toString() : string
Properties
$_class
protected
mixed
$_class
$_code
protected
mixed
$_code
$_identifier
protected
mixed
$_identifier
$_isSticky
protected
mixed
$_isSticky
= \false
$_method
protected
mixed
$_method
$_textArgs
protected
array<int, string|Link|null>|null
$_textArgs
= \null
$_type
protected
mixed
$_type
Methods
__construct()
Mage_Core_Model_Message_Abstract constructor.
public
__construct(string $type[, string $code = '' ]) : mixed
Parameters
- $type : string
- $code : string = ''
formatText()
Replace each %s placeholder in $text with one argument. $renderArg converts each argument to a string first. All renderers use this method, so the plain text and the HTML get the same values. If $text does not match the arguments, this method calls $onError and returns $text unchanged. A bad message does not stop the page.
public
formatText(string $text, callable(Array): string $renderArg[, callable(Throwable): mixed|null $onError = null ]) : string
Parameters
- $text : string
- $renderArg : callable(Array): string
- $onError : callable(Throwable): mixed|null = null
Return values
stringgetCode()
public
getCode() : string
Return values
stringgetIdentifier()
Get message identifier
public
getIdentifier() : mixed
@return string
getIsSticky()
Get whether message is sticky
public
getIsSticky() : bool
Return values
boolgetText()
Get the plain text of the message. Each %s placeholder is replaced with its argument.
public
getText() : string
A \Maho\Message\Link argument is replaced with its label. This text identifies the message.
An HTML renderer must use getCode() and getTextArgs() and escape each part. If the format string is bad, this method returns the raw text and does not report the error.
Return values
stringgetTextArgs()
public
getTextArgs() : array<int, string|Link|null>|null
Return values
array<int, string|Link|null>|null —null when the message was not added as plain text
getType()
public
getType() : string
Return values
stringsetClass()
public
setClass(string $class) : $this
Parameters
- $class : string
Return values
$thissetCode()
Set code
public
setCode(string $code) : Mage_Core_Model_Message_Abstract
Parameters
- $code : string
Return values
Mage_Core_Model_Message_AbstractsetIdentifier()
Set message identifier
public
setIdentifier(string $id) : Mage_Core_Model_Message_Abstract
Parameters
- $id : string
Return values
Mage_Core_Model_Message_AbstractsetIsSticky()
Set message sticky status
public
setIsSticky([bool $isSticky = true ]) : Mage_Core_Model_Message_Abstract
Parameters
- $isSticky : bool = true
Return values
Mage_Core_Model_Message_AbstractsetMethod()
public
setMethod(string $method) : $this
Parameters
- $method : string
Return values
$thissetTextArgs()
Set the values for the %s placeholders in the message text.
public
setTextArgs(array<int, string|Link|null> $args) : static
The renderer escapes each value. Do not escape a value in the caller. A \Maho\Message\Link value renders as an anchor. A newline in the text renders as a line break.
Parameters
- $args : array<int, string|Link|null>
Return values
statictoString()
public
toString() : string