public function addToCounter($eventType, $count)
    {
        if (!isset($this->totalEvents[$eventType])) {
            $this->totalEvents[$eventType] = 0;
        }

        if (is_array($count)) {
            if (isset($count['total'])) {
                $this->totalEvents[$eventType] += $count['total'];
            } elseif ($this->isEngagementCount() && $this->groupUnit) {
                // Group counts across events by unit
                foreach ($count as $key => $data) {
                    if (!isset($this->totalEventsByUnit[$key])) {
                        $this->totalEventsByUnit[$key] = 0;
                    }
                    $this->totalEventsByUnit[$key] += (int) $data;
                    $this->totalEvents[$eventType] += (int) $data;
                }
            } else {
                $this->totalEvents[$eventType] = array_sum($count);
            }
        } else {
            $this->totalEvents[$eventType] += (int) $count;
        }
    }
public function addToCounter($eventType, $count)
    {
        if (!isset($this->totalEvents[$eventType])) {
            $this->totalEvents[$eventType] = 0;
        }

        if (is_array($count)) {
            if (isset($count['total'])) {
                $this->totalEvents[$eventType] += $count['total'];
            } elseif ($this->isEngagementCount() && $this->groupUnit) {
                // Group counts across events by unit
                foreach ($count as $key => $data) {
                    if (!isset($this->totalEventsByUnit[$key])) {
                        $this->totalEventsByUnit[$key] = 0;
                    }
                    $this->totalEventsByUnit[$key] += (int) $data;
                    $this->totalEvents[$eventType] += (int) $data;
                }
            } else {
                $this->totalEvents[$eventType] = array_sum($count);
            }
        } else {
            $this->totalEvents[$eventType] += (int) $count;
        }
    }
public function addToCounter ( $ eventType , $ count ) { if ( ! isset ( $ this -> totalEvents [ $ eventType ] ) ) { $ this -> totalEvents [ $ eventType ] = 0 ; } if ( is_array ( $ count ) ) { if ( isset ( $ count [ 'total' ] ) ) { $ this -> totalEvents [ $ eventType ] += $ count [ 'total' ] ; } elseif ( $ this -> isEngagementCount ( ) && $ this -> groupUnit ) { // Group counts across events by unit foreach ( $ count as $ key => $ data ) { if ( ! isset ( $ this -> totalEventsByUnit [ $ key ] ) ) { $ this -> totalEventsByUnit [ $ key ] = 0 ; } $ this -> totalEventsByUnit [ $ key ] += ( int ) $ data ; $ this -> totalEvents [ $ eventType ] += ( int ) $ data ; } } else { $ this -> totalEvents [ $ eventType ] = array_sum ( $ count ) ; } } else { $ this -> totalEvents [ $ eventType ] += ( int ) $ count ; } }
Add to the event counters.

@param int|array $count
Add to the event counters .