PHP Class Pheasant\Database\FilterChain

Show file Open project: lox/pheasant Class Usage Examples

Public Methods

Method Description
clear ( ) Clears all callbacks
execute ( $sql, $executor ) : result Executes the query through the internal filters and executor
onError ( $callback ) Attach an error handler, gets called with the exception, return ignored
onQuery ( $callback ) Attach an intercepting filter, gets called with query, returns query
onResult ( $callback ) Attach an results filter, gets called with the query, result and the time taken, returns result

Method Details

clear() public method

Clears all callbacks
public clear ( )

execute() public method

Executes the query through the internal filters and executor
public execute ( $sql, $executor ) : result
return result set of some sort

onError() public method

Attach an error handler, gets called with the exception, return ignored
public onError ( $callback )

onQuery() public method

Attach an intercepting filter, gets called with query, returns query
public onQuery ( $callback )

onResult() public method

Attach an results filter, gets called with the query, result and the time taken, returns result
public onResult ( $callback )