public function addContextEvent($event = [])
    {
        $contactId                       = isset($this->context['id']) ? $this->context['id'] : 0;
        $this->context['event']['id']    = !empty($event['id']) ? (int) $event['id'] : null;
        $this->context['event']['name']  = !empty($event['name']) ? $event['name'] : null;
        $this->context['event']['token'] = null;
        if ($contactId || $this->context['event']['id'] || $this->context['campaign']['id']) {
            $this->context['event']['token'] = $this->eventTokenEncode(
                [
                    $this->context['campaign']['id'],
                    $this->context['event']['id'],
                    $contactId,
                ]
            );
        }
    }
public function addContextEvent($event = [])
    {
        $contactId                       = isset($this->context['id']) ? $this->context['id'] : 0;
        $this->context['event']['id']    = !empty($event['id']) ? (int) $event['id'] : null;
        $this->context['event']['name']  = !empty($event['name']) ? $event['name'] : null;
        $this->context['event']['token'] = null;
        if ($contactId || $this->context['event']['id'] || $this->context['campaign']['id']) {
            $this->context['event']['token'] = $this->eventTokenEncode(
                [
                    $this->context['campaign']['id'],
                    $this->context['event']['id'],
                    $contactId,
                ]
            );
        }
    }
public function addContextEvent ( $ event = [ ] ) { $ contactId = isset ( $ this -> context [ 'id' ] ) ? $ this -> context [ 'id' ] : 0 ; $ this -> context [ 'event' ] [ 'id' ] = ! empty ( $ event [ 'id' ] ) ? ( int ) $ event [ 'id' ] : null ; $ this -> context [ 'event' ] [ 'name' ] = ! empty ( $ event [ 'name' ] ) ? $ event [ 'name' ] : null ; $ this -> context [ 'event' ] [ 'token' ] = null ; if ( $ contactId || $ this -> context [ 'event' ] [ 'id' ] || $ this -> context [ 'campaign' ] [ 'id' ] ) { $ this -> context [ 'event' ] [ 'token' ] = $ this -> eventTokenEncode ( [ $ this -> context [ 'campaign' ] [ 'id' ] , $ this -> context [ 'event' ] [ 'id' ] , $ contactId , ] ) ; } }
Take an event array and use it to enhance the context for later dispositional callback.
Campaign context should be added before this, as it is used for the token.

@param array $event
Take an event array and use it to enhance the context for later dispositional callback . Campaign context should be added before this as it is used for the token .