Difference between revisions of "JError/isError"
From Joomla! Documentation
< API15:JError
(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 (removing red link to edit, no existant pages) |
||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 17: | Line 17: | ||
!Description | !Description | ||
|- | |- | ||
− | | | + | | &$object |
| | | | ||
| &$object Object to check | | &$object Object to check | ||
Line 43: | Line 43: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
Line 58: | Line 58: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API15]] |
Revision as of 11:49, 12 May 2013
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Method to determine if a value is an exception object. This check supports both JException and PHP5 Exception objects
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
isError(&$object)
Parameter Name | Default Value | Description |
---|---|---|
&$object | &$object Object to check |
Returns[edit]
boolean True if argument is an exception, false otherwise.
Defined in[edit]
libraries/joomla/error/error.php
Importing[edit]
jimport( 'joomla.error.error' );
Source Body[edit]
function isError(& $object)
{
if (!is_object($object)) {
return false;
}
// supports PHP 5 exception handling
return is_a($object, 'JException') || is_a($object, 'JError') || is_a($object, 'Exception');
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
<CodeExamplesForm />