protected function addPendingEvent($connection, $event, $payload)
    {
        $connectionId = $connection->getName();
        $transactionLevel = $this->transactionLevel;

        $eventData = [
            'event' => $event,
            'payload' => is_object($payload) ? clone $payload : $payload,
        ];
        $transactionLevelEvents = &$this->pendingEvents[$connectionId][$transactionLevel];
        $transactionLevelEvents[count($transactionLevelEvents) - 1][] = $eventData;
    }
protected function addPendingEvent($connection, $event, $payload)
    {
        $connectionId = $connection->getName();
        $transactionLevel = $this->transactionLevel;

        $eventData = [
            'event' => $event,
            'payload' => is_object($payload) ? clone $payload : $payload,
        ];
        $transactionLevelEvents = &$this->pendingEvents[$connectionId][$transactionLevel];
        $transactionLevelEvents[count($transactionLevelEvents) - 1][] = $eventData;
    }
protected function addPendingEvent ( $ connection , $ event , $ payload ) { $ connectionId = $ connection -> getName ( ) ; $ transactionLevel = $ this -> transactionLevel ; $ eventData = [ 'event' => $ event , 'payload' => is_object ( $ payload ) ? clone $ payload : $ payload , ] ; $ transactionLevelEvents = & $ this -> pendingEvents [ $ connectionId ] [ $ transactionLevel ] ; $ transactionLevelEvents [ count ( $ transactionLevelEvents ) - 1 ] [ ] = $ eventData ; }
Add a transactional event waiting for transaction to commit.

@param  \Illuminate\Database\ConnectionInterface  $connection
@param  string|object $event
@param  mixed $payload
@return void
Add a transactional event waiting for transaction to commit .