src/Buffered/Utils/Defer.php
public function commit()
    {
        list($old, $new) = $this->generateRollback();
        $updates = $this->generateUpdates();
        $updates = $this->combineUpdates($updates);
        usort($updates, array($this, 'sortUpdates'));

        foreach ($updates as $update) {
            // apply update to cache & receive a simple bool to indicate
            // success (true) or failure (false)
            $success = call_user_func_array($update[1], $update[2]);
            if ($success === false) {
                $this->rollback($old, $new);

                return false;
            }
        }

        $this->clear();

        return true;
    }
public function commit()
    {
        list($old, $new) = $this->generateRollback();
        $updates = $this->generateUpdates();
        $updates = $this->combineUpdates($updates);
        usort($updates, array($this, 'sortUpdates'));

        foreach ($updates as $update) {
            // apply update to cache & receive a simple bool to indicate
            // success (true) or failure (false)
            $success = call_user_func_array($update[1], $update[2]);
            if ($success === false) {
                $this->rollback($old, $new);

                return false;
            }
        }

        $this->clear();

        return true;
    }
public function commit ( ) { list ( $ old , $ new ) = $ this -> generateRollback ( ) ; $ updates = $ this -> generateUpdates ( ) ; $ updates = $ this -> combineUpdates ( $ updates ) ; usort ( $ updates , array ( $ this , 'sortUpdates' ) ) ; foreach ( $ updates as $ update ) { // apply update to cache & receive a simple bool to indicate // success (true) or failure (false) $ success = call_user_func_array ( $ update [ 1 ] , $ update [ 2 ] ) ; if ( $ success === false ) { $ this -> rollback ( $ old , $ new ) ; return false ; } } $ this -> clear ( ) ; return true ; }
Commit all deferred writes to cache.

When the commit fails, no changes in this transaction will be applied
(and those that had already been applied will be undone). False will
be returned in that case.

@return bool
Commit all deferred writes to cache .