Skip to content

onError, onSuccess in transaction #22

@asmdk

Description

@asmdk

php 5.6.12

im use transaction with callback:

->onError(function(PDOException $e, $transaction){ //code write log throw new \PDOException($e->getMessage()); }) ->onSuccess(function($transaction){ //code write log })

both methods i have fatal error, for example:
Fatal error: Call to undefined method Opis\Database\Transaction::successCallback()

that will be corrected in \opis\database\lib\Transaction.php, method execute, we should replace
if ($this->successCallback !== null) { $this->successCallback($this); }
on
if ($this->successCallback !== null) { call_user_func($this->successCallback, $this); }
got error callback the same...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions