-
Notifications
You must be signed in to change notification settings - Fork 0
API ErrorManager
Christophe SAUVEUR edited this page Sep 29, 2024
·
2 revisions
final class ErrorManager
Integrated error management class
Since 1.0
public function __construct(Services\IConfigService $configService, Services\ISessionService $sessionService)
Constructor
Since 2.0
Name | Type | Description |
---|---|---|
$configService |
IConfigService |
Config service instance |
$sessionService |
ISessionService |
Session service instance |
Exception | Reason |
---|---|
MFXException |
public function flush(?Twig\Environment $twig = null): string
Flushes error and notification messages for template display
Since 2.0
Name | Type | Description |
---|---|---|
$twig |
\Twig_Environment |
Twig environment. If NULL, the function flushes containers only and returns an empty string |
string
public function flushToArrayOrObject(object|array &$arrOrObject)
Flushes error and notification messages to an array or an object
Since 2.0
Name | Type | Description |
---|---|---|
$arrOrObject |
`array | object` |
public function freeze(bool $flush = false)
Freezes the error manager state into session data
Since 2.0
Name | Type | Description |
---|---|---|
$flush |
bool |
If set, flushes error containers. (Defaults to false) |
public function hasError(): bool
Tells if the manager holds at least one error.
Since 2.0
boolean
public function hasNotif(): bool
Tells if the manager holds at least one notification.
Since 2.0
boolean
Getting Started | Framework Reference | API Reference | MFX is released under the MIT license