Return or manage warnings recorded by just this object or all Wire objects
This method returns and manages warnings that were previously set by Wire::warning()
.
Example
// Get warnings for one object
$warnings = $obj->warnings();
// Get first warning in object
$warning = $obj->warnings('first');
// Get warnings for all Wire objects
$warnings = $obj->warnings('all');
// Get and clear all warnings for all Wire objects
$warnings = $obj->warnings('clear all');
Usage
// basic usage
$notices = $wire->warnings();
// usage with all arguments
$notices = $wire->warnings($options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
options (optional) | string, array | One or more of array elements or space separated string of:
|
Return value
Notices
array
string
Array of NoticeWarning
warnings, or string if last, first or str option was specified.
API reference based on ProcessWire core version 3.0.236