Documentation

Group extends Exception
in package
implements ArrayAccess, IteratorAggregate, Countable

Class \Hoa\Exception\Group.

This is an exception that contains a group of exceptions.

Tags
copyright

Copyright © 2007-2017 Hoa community

license

New BSD License

Table of Contents

Interfaces

ArrayAccess
IteratorAggregate
Countable

Properties

$_arguments  : array<string|int, mixed>
Arguments to format message.
$_group  : SplStack
All exceptions (stored in a stack for transactions).
$_previous  : Exception
Previous.
$_rawMessage  : string
Original message.
$_tmpArguments  : array<string|int, mixed>
Delay processing on arguments.
$_trace  : array<string|int, mixed>
Backtrace.

Methods

__construct()  : mixed
Create an exception.
__toString()  : string
String representation of object.
beginTransaction()  : Group
Begin a transaction.
commitTransaction()  : Group
Commit a transaction.
count()  : int
Count the number of committed exceptions.
enableUncaughtHandler()  : mixed
Enable uncaught exception handler.
getArguments()  : array<string|int, mixed>
Get arguments for the message.
getBacktrace()  : array<string|int, mixed>
Get the backtrace.
getExceptions()  : ArrayObject
Get committed exceptions in the group.
getFormattedMessage()  : string
Get the message already formatted.
getFrom()  : string
Get the source of the exception (class, method, function, main etc.).
getIterator()  : ArrayIterator
Get an iterator over all exceptions (committed or not).
getPreviousThrow()  : Exception
Get previous.
getRawMessage()  : string
Get the raw message.
getStackSize()  : int
Count the stack size, i.e. the number of opened transactions.
hasUncommittedExceptions()  : bool
Check if there is uncommitted exceptions.
offsetExists()  : bool
Check if an index in the group exists.
offsetGet()  : Exception
Get an exception from the group.
offsetSet()  : void
Set an exception in the group.
offsetUnset()  : void
Remove an exception in the group.
raise()  : string
Raise an exception as a string.
rollbackTransaction()  : Group
Rollback a transaction.
send()  : void
Send the exception on hoa://Event/Exception.
uncaught()  : void
Catch uncaught exception (only \Hoa\Exception\Idle and children).

Properties

$_arguments

Arguments to format message.

protected array<string|int, mixed> $_arguments = null

$_group

All exceptions (stored in a stack for transactions).

protected SplStack $_group = null

$_previous

Previous.

protected Exception $_previous = null

$_rawMessage

Original message.

protected string $_rawMessage = null

$_tmpArguments

Delay processing on arguments.

protected array<string|int, mixed> $_tmpArguments = null

$_trace

Backtrace.

protected array<string|int, mixed> $_trace = null

Methods

__construct()

Create an exception.

public __construct(string $message[, int $code = 0 ][, array<string|int, mixed> $arguments = [] ][, Exception $previous = null ]) : mixed
Parameters
$message : string

Formatted message.

$code : int = 0

Code (the ID).

$arguments : array<string|int, mixed> = []

Arguments to format message.

$previous : Exception = null

Previous exception in chaining.

__toString()

String representation of object.

public __toString() : string
Return values
string

beginTransaction()

Begin a transaction.

public beginTransaction() : Group
Return values
Group

commitTransaction()

Commit a transaction.

public commitTransaction() : Group
Return values
Group

count()

Count the number of committed exceptions.

public count() : int
Return values
int

enableUncaughtHandler()

Enable uncaught exception handler.

public static enableUncaughtHandler([bool $enable = true ]) : mixed

This is restricted to Hoa's exceptions only.

Parameters
$enable : bool = true

Enable.

getArguments()

Get arguments for the message.

public getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>

getBacktrace()

Get the backtrace.

public getBacktrace() : array<string|int, mixed>

Do not use \Exception::getTrace() any more.

Return values
array<string|int, mixed>

getExceptions()

Get committed exceptions in the group.

public getExceptions() : ArrayObject
Return values
ArrayObject

getFormattedMessage()

Get the message already formatted.

public getFormattedMessage() : string
Return values
string

getFrom()

Get the source of the exception (class, method, function, main etc.).

public getFrom() : string
Return values
string

getIterator()

Get an iterator over all exceptions (committed or not).

public getIterator() : ArrayIterator
Return values
ArrayIterator

getPreviousThrow()

Get previous.

public getPreviousThrow() : Exception

Do not use \Exception::getPrevious() any more.

Return values
Exception

getRawMessage()

Get the raw message.

public getRawMessage() : string
Return values
string

getStackSize()

Count the stack size, i.e. the number of opened transactions.

public getStackSize() : int
Return values
int

hasUncommittedExceptions()

Check if there is uncommitted exceptions.

public hasUncommittedExceptions() : bool
Return values
bool

offsetExists()

Check if an index in the group exists.

public offsetExists(mixed $index) : bool
Parameters
$index : mixed

Index.

Return values
bool

offsetGet()

Get an exception from the group.

public offsetGet(mixed $index) : Exception
Parameters
$index : mixed

Index.

Return values
Exception

offsetSet()

Set an exception in the group.

public offsetSet(mixed $index, Exception $exception) : void
Parameters
$index : mixed

Index.

$exception : Exception

Exception.

offsetUnset()

Remove an exception in the group.

public offsetUnset(mixed $index) : void
Parameters
$index : mixed

Index.

raise()

Raise an exception as a string.

public raise([bool $previous = false ]) : string
Parameters
$previous : bool = false

Whether raise previous exception if exists.

Return values
string

rollbackTransaction()

Rollback a transaction.

public rollbackTransaction() : Group
Return values
Group

send()

Send the exception on hoa://Event/Exception.

public send() : void

uncaught()

Catch uncaught exception (only \Hoa\Exception\Idle and children).

public static uncaught(Throwable $exception) : void
Parameters
$exception : Throwable

The exception.

Tags
throws
Throwable

        
On this page

Search results