src/Common/Service/Event.php
protected function addHistory($sEvent, $sNamespace = 'nails/common')
    {
        $sEvent     = strtoupper($sEvent);
        $sNamespace = strtoupper($sNamespace);

        if (!array_key_exists($sNamespace, $this->aHistory)) {
            $this->aHistory[$sNamespace] = [];
        }
        if (!array_key_exists($sEvent, $this->aHistory[$sNamespace])) {
            $this->aHistory[$sNamespace][$sEvent] = (object) [
                'count'      => 0,
                'timestamps' => [],
            ];
        }

        $this->aHistory[$sNamespace][$sEvent]->count++;
        $this->aHistory[$sNamespace][$sEvent]->timestamps[] = microtime(true);
        return $this;
    }
protected function addHistory($sEvent, $sNamespace = 'nails/common')
    {
        $sEvent     = strtoupper($sEvent);
        $sNamespace = strtoupper($sNamespace);

        if (!array_key_exists($sNamespace, $this->aHistory)) {
            $this->aHistory[$sNamespace] = [];
        }
        if (!array_key_exists($sEvent, $this->aHistory[$sNamespace])) {
            $this->aHistory[$sNamespace][$sEvent] = (object) [
                'count'      => 0,
                'timestamps' => [],
            ];
        }

        $this->aHistory[$sNamespace][$sEvent]->count++;
        $this->aHistory[$sNamespace][$sEvent]->timestamps[] = microtime(true);
        return $this;
    }
protected function addHistory ( $ sEvent , $ sNamespace = 'nails/common' ) { $ sEvent = strtoupper ( $ sEvent ) ; $ sNamespace = strtoupper ( $ sNamespace ) ; if ( ! array_key_exists ( $ sNamespace , $ this -> aHistory ) ) { $ this -> aHistory [ $ sNamespace ] = [ ] ; } if ( ! array_key_exists ( $ sEvent , $ this -> aHistory [ $ sNamespace ] ) ) { $ this -> aHistory [ $ sNamespace ] [ $ sEvent ] = ( object ) [ 'count' => 0 , 'timestamps' => [ ] , ] ; } $ this -> aHistory [ $ sNamespace ] [ $ sEvent ] -> count ++ ; $ this -> aHistory [ $ sNamespace ] [ $ sEvent ] -> timestamps [ ] = microtime ( true ) ; return $ this ; }
Adds a history item to the history array

@param string $sEvent     The event name
@param string $sNamespace The event namespace

@return $this
Adds a history item to the history array