JError/isError: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Method to determine if a value is an exception object. This check supports both JException and PHP5 Exception objects
<span class="editsection" style="font-size:76%;">... |
m preparing for archive only |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
Method to determine if a value is an exception object. This check supports both JException and PHP5 Exception objects | Method to determine if a value is an exception object. This check supports both JException and PHP5 Exception objects | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 17: | Line 15: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$object | ||
| | | | ||
| &$object Object to check | | &$object Object to check | ||
| Line 42: | Line 40: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | |||
< | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=isError | category=isError | ||
category=JError | category=JError | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API16]] | |||
Latest revision as of 01:37, 25 March 2017
Description
Method to determine if a value is an exception object. This check supports both JException and PHP5 Exception objects
<! removed transcluded page call, red link never existed >
Syntax
static isError(&$object)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$object | &$object Object to check |
Returns
boolean True if argument is an exception, false otherwise.
Defined in
libraries/joomla/error/error.php
Importing
jimport( 'joomla.error.error' );
Source Body
public static function isError(& $object)
{
if (!is_object($object)) {
return false;
}
// supports PHP 5 exception handling
return $object INSTANCEOF Exception;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples