Message model factory
Definition at line 14 of file Factory.php.
◆ __construct()
◆ create()
create |
( |
|
$type, |
|
|
|
$text = null |
|
) |
| |
Create a message instance of a given type with given text.
- Parameters
-
string | null | $type | The message type to create, must correspond to a message type under the namespace Magento\Framework\Message\ |
string | $text | The text to inject into the message |
- Exceptions
-
Definition at line 54 of file Factory.php.
56 if (!in_array(
$type, $this->types)) {
57 throw new \InvalidArgumentException(
'Wrong message type');
63 if (!
$message instanceof MessageInterface) {
64 throw new \InvalidArgumentException(
65 $className .
' doesn\'t implement \Magento\Framework\Message\MessageInterface'
◆ $objectManager
◆ $types
The documentation for this class was generated from the following file: