PHP Class BaseException, atk4

Inheritance: extends Exception
显示文件 Open project: atk4/atk4 Class Usage Examples

Public Properties

Property Type Description
$actions Array of available actions
$api
$app Always points to current Application
$by_exception Link to another exception which caused this one
$code error code
$more_info Array with more info
$my_backtrace Backtrace array
$name Classname of exception
$owner Link to object into which we added this object
$recommendation Plain text recommendation on how the problem can be solved
$shift Backtrace shift

Public Methods

Method Description
__construct ( string $msg, string | integer $code ) On class construct.
addAction ( string | array $key, string | array $descr ) Actions will be displayed as links on the exception page allowing viewer to perform additional debug functions.
addMoreInfo ( string $key, mixed $value ) Call this to add additional information to the exception you are about to throw.
addThis ( AbstractObject $obj ) Add reference to the object.
backtrace ( integer $sh = null, array $backtrace = null ) : string
by ( Exception $e ) Records another exception as a cause of your current exception.
collectBasicData ( string | integer $code ) Collect basic data of exception.
getAdditionalMessage ( ) : string Undocumented.
getDetailedHTML ( ) : string Redefine this function to add additional HTML output.
getDocURL ( AbstractObject $o ) : boolean | string Classes define a DOC constant which points to a on-line resource containing documentation for given class. This method will return full URL for the specified object.
getHTML ( ) : string Returns HTML representation of the exception.
getHTMLActions ( ) : string
getHTMLHeader ( ) : string
getHTMLSolution ( ) : string
getHeader ( ) : string
getMyFile ( ) : string Return filename from backtrace log.
getMyLine ( ) : string Return line number from backtract log.
getMyTrace ( ) : array Return collected backtrace info.
getSolution ( ) : array
getText ( ) : string Returns Textual representation of the exception.
init ( ) Initialization.
print_r ( array | object | string $key, string $gs, string $ge, string $ls, string $le, string $ind = ' ' ) : null | string Utility.
setCode ( integer $code ) Set error code

Method Details

__construct() public method

On class construct.
public __construct ( string $msg, string | integer $code )
$msg string Error message
$code string | integer Error code

addAction() public method

addAction('show info',array('info'=>true)) will result in link to &info=1.
public addAction ( string | array $key, string | array $descr )
$key string | array
$descr string | array

addMoreInfo() public method

Call this to add additional information to the exception you are about to throw.
public addMoreInfo ( string $key, mixed $value )
$key string
$value mixed

addThis() public method

Do not call this directly, exception() method takes care of that.
public addThis ( AbstractObject $obj )
$obj AbstractObject

backtrace() public method

public backtrace ( integer $sh = null, array $backtrace = null ) : string
$sh integer
$backtrace array
return string

by() public method

Wrapping one exception inside another helps you to track problems better.
public by ( Exception $e )
$e Exception

collectBasicData() public method

Collect basic data of exception.
public collectBasicData ( string | integer $code )
$code string | integer Error code

getAdditionalMessage() public method

Undocumented.
public getAdditionalMessage ( ) : string
return string

getDetailedHTML() public method

Redefine this function to add additional HTML output.
public getDetailedHTML ( ) : string
return string

getDocURL() public method

Classes define a DOC constant which points to a on-line resource containing documentation for given class. This method will return full URL for the specified object.
public getDocURL ( AbstractObject $o ) : boolean | string
$o AbstractObject
return boolean | string

getHTML() public method

Returns HTML representation of the exception.
public getHTML ( ) : string
return string

getHTMLActions() public method

public getHTMLActions ( ) : string
return string

getHTMLHeader() public method

public getHTMLHeader ( ) : string
return string

getHTMLSolution() public method

public getHTMLSolution ( ) : string
return string

getHeader() public method

public getHeader ( ) : string
return string

getMyFile() public method

Return filename from backtrace log.
public getMyFile ( ) : string
return string

getMyLine() public method

Return line number from backtract log.
public getMyLine ( ) : string
return string

getMyTrace() public method

Return collected backtrace info.
public getMyTrace ( ) : array
return array

getSolution() public method

public getSolution ( ) : array
return array

getText() public method

Returns Textual representation of the exception.
public getText ( ) : string
return string

init() public method

Initialization.
public init ( )

print_r() public method

Utility.
public print_r ( array | object | string $key, string $gs, string $ge, string $ls, string $le, string $ind = ' ' ) : null | string
$key array | object | string
$gs string
$ge string
$ls string
$le string
$ind string
return null | string

setCode() public method

Set error code
public setCode ( integer $code )
$code integer

Property Details

$actions public_oe property

Array of available actions
public $actions

$api public_oe property

Deprecation: 4.3.0 Left for compatibility with ATK 4.2 and lower, use ->app instead
public $api

$app public_oe property

Always points to current Application
public $app

$by_exception public_oe property

Link to another exception which caused this one
public $by_exception

$code public_oe property

error code
public $code

$more_info public_oe property

Array with more info
public $more_info

$my_backtrace public_oe property

Backtrace array
public $my_backtrace

$name public_oe property

Classname of exception
public $name

$owner public_oe property

Link to object into which we added this object
public $owner

$recommendation public_oe property

Plain text recommendation on how the problem can be solved
public $recommendation

$shift public_oe property

Backtrace shift
public $shift