Class for working with messages - errors, warnings etc.
| Properties | |
|---|---|
|
protected
|
Internal variable for storing the state whether technical details, programmer warnings and debug information are also sent to the client. |
|
protected
|
Internal variable for storing the messages. |
|
protected
|
Internal variable for storing the flag that defines whether for each debug output the source file and line number are written from where it is called. |
| Methods | |
|---|---|
|
public
|
Stores the information message to be reported. |
|
public
|
Stores the debugging message to be reported. |
|
public
|
Stores the error to be reported. |
|
public
|
Stores the error to be reported. |
|
public
|
Stores the information message to be reported. |
|
public
|
Stores the programming warning to be reported. |
|
public
|
Stores the warning to be reported. |
|
public
|
Clears all stored messages and active elements. |
|
public
|
Clears the stored information messages. |
|
public
|
Clears the stored debugging messages. |
|
public
|
Clears the stored error messages. |
|
public
|
Clears the stored information messages. |
|
public
|
Clears the stored programming warning messages. |
|
public
|
Clears the stored warning messages. |
|
public
|
Returns the array of information messages if any have been stored. |
|
public
|
Returns the array of debugging messages if any have been stored. |
|
public
|
Returns the array of errors if any have been stored. |
|
public
|
Returns the array of information messages if any have been stored. |
|
protected
|
This auxiliary function returns the messages of the desired type. |
|
public
|
Returns the array of programming warnings if any have been stored. |
|
public
|
Returns the array of warnings if any have been stored. |
|
public
|
Checks whether an information message exist. |
|
public
|
Checks whether a stored debugging message exist. |
|
public
|
Checks whether a stored error message exist. |
|
public
|
Checks whether an information message exist. |
|
public
|
Checks whether a stored programming warning exist. |
|
public
|
Checks whether a stored error warning exist. |
|
public
|
Initializes the message manager. |
Internal variable for storing the state whether technical details, programmer warnings and debug information are also sent to the client.
Internal variable for storing the messages.
Internal variable for storing the flag that defines whether for each debug output the source file and line number are written from where it is called.
Stores the information message to be reported.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $message | by value | string |
The information message to be reported. |
|
| $details | by value | array | [] |
The details might be useful if the message translations are provided on the client, not on the server, and the message should contain some details that may vary from case to case. In that case, the servers return the message id instead of final text and the details, the client uses the message id, gets the final translated text and substitutes the parameters through the details. |
| $autoclose | by value | bool | true |
The flag that controls whether the message box should be closed automatically after a time. |
Stores the debugging message to be reported.
Displaying of the debugging messages might be implemented to simplify the debugging process, e.g. to the browser console or in a lightbox.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $message | by value | string |
The debugging message to be reported. |
|
| $file | by value | string | "" |
The source file where the debug output occurred. Per default, the file where the debug output called. |
| $line | by value | string | "" |
The source file line where the debug output occurred. Per default, the file line where the debug output called. |
Stores the error to be reported.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $message | by value | string |
The error message to be reported. |
|
| $details | by value | array | [] |
The details might be useful if the message translations are provided on the client, not on the server, and the message should contain some details that may vary from case to case. In that case, the servers return the message id instead of final text and the details, the client uses the message id, gets the final translated text and substitutes the parameters through the details. |
| $related_element | by value | string | "" |
The error element associated with the error. |
| $code | by value | string | "" |
The error code to be reported. |
| $technical_info | by value | string | "" |
The technical information for the error. Displaying of this part might be controlled over an option "debug_mode". |
| $file | by value | string | "" |
The source file where the error occurred. Per default, the file where the adding error called. |
| $line | by value | string | "" |
The source file line where the error occurred. Per default, the file line where the adding error called. |
Stores the error to be reported.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $smart_exception | by value | \SmartFactory\SmartException|\SmartFactory\SmartExceptionCollection |
The exception object of collection of exceptions. |
Stores the information message to be reported.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $message | by value | string |
The information message to be reported. |
|
| $details | by value | array | [] |
The details might be useful if the message translations are provided on the client, not on the server, and the message should contain some details that may vary from case to case. In that case, the servers return the message id instead of final text and the details, the client uses the message id, gets the final translated text and substitutes the parameters through the details. |
| $autoclose | by value | bool | false |
The flag that controls whether the message box should be closed automatically after a time. |
Stores the programming warning to be reported.
Programming warnings are shown only if the option "show programming warning" is active.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $message | by value | string |
The programming warning message to be reported. |
|
| $file | by value | string | "" |
The source file where the error occurred. Per default, the file where the adding error called. |
| $line | by value | string | "" |
The source file line where the error occurred. Per default, the file line where the adding error called. |
Stores the warning to be reported.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $message | by value | string |
The warning message to be reported. |
|
| $details | by value | array | [] |
The details might be useful if the message translations are provided on the client, not on the server, and the message should contain some details that may vary from case to case. In that case, the servers return the message id instead of final text and the details, the client uses the message id, gets the final translated text and substitutes the parameters through the details. |
| $related_element | by value | string | "" |
The error element associated with the warning. |
Clears all stored messages and active elements.
Clears the stored information messages.
Clears the stored debugging messages.
Clears the stored error messages.
Clears the stored information messages.
Clears the stored programming warning messages.
Clears the stored warning messages.
Returns the array of information messages if any have been stored.
When the messages are requested, it is assumed they will be displayed. Thus, the message array is cleared to avoid displaying of the same messages twice.
Returns the array of information messages if any have been stored.
Returns the array of debugging messages if any have been stored.
When the messages are requested, it is assumed they will be displayed. Thus, the message array is cleared to avoid displaying of the same messages twice.
Returns the array of debugging messages if any have been stored.
Returns the array of errors if any have been stored.
When the messages are requested, it is assumed they will be displayed. Thus, the message array is cleared to avoid displaying of the same messages twice.
Returns the array of errors if any have been stored.
Returns the array of information messages if any have been stored.
When the messages are requested, it is assumed they will be displayed. Thus, the message array is cleared to avoid displaying of the same messages twice.
Returns the array of information messages if any have been stored.
This auxiliary function returns the messages of the desired type.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $messages | by value | array |
The messages to be retrieved. |
Returns the array of messages.
Returns the array of programming warnings if any have been stored.
When the messages are requested, it is assumed they will be displayed. Thus, the message array is cleared to avoid displaying of the same messages twice.
Returns the array of programming warnings if any have been stored.
Returns the array of warnings if any have been stored.
When the messages are requested, it is assumed they will be displayed. Thus, the message array is cleared to avoid displaying of the same messages twice.
Returns the array of warnings if any have been stored.
Checks whether an information message exist.
Returns true if the information message exists, otherwise false.
Checks whether a stored debugging message exist.
Returns true if the stored debugging message exists, otherwise false.
Checks whether a stored error message exist.
Returns true if the stored error message exists, otherwise false.
Checks whether an information message exist.
Returns true if the information message exists, otherwise false.
Checks whether a stored programming warning exist.
Returns true if the stored programming warning message exists, otherwise false.
Checks whether a stored error warning exist.
Returns true if the stored warning message exists, otherwise false.
Initializes the message manager.
| Name | Pass type | Value type | Default value | Description |
|---|---|---|---|---|
| $parameters | by value | array |
Settings for message management as an associative array in the form key => value:
|
It might throw an exception in the case of any errors.