src/EventListener/AdminTrackerListener.php
protected function updateTrackedInfo($session, $sessionKey, $trackInfoArray, $limit = 5)
    {
        // save the url, controller and action in the session
        $value = json_decode($session->get($sessionKey), true);
        if (is_null($value)) {
            $value = [];
        }
        // add new value as first value (to the top of the stack)
        array_unshift(
            $value,
            $trackInfoArray
        );

        // remove last value, if array has more than limit items
        if ($limit > 0 and count($value) > $limit) {
            array_pop($value);
        }

        // set the session value
        $session->set($sessionKey, json_encode($value));
    }
protected function updateTrackedInfo($session, $sessionKey, $trackInfoArray, $limit = 5)
    {
        // save the url, controller and action in the session
        $value = json_decode($session->get($sessionKey), true);
        if (is_null($value)) {
            $value = [];
        }
        // add new value as first value (to the top of the stack)
        array_unshift(
            $value,
            $trackInfoArray
        );

        // remove last value, if array has more than limit items
        if ($limit > 0 and count($value) > $limit) {
            array_pop($value);
        }

        // set the session value
        $session->set($sessionKey, json_encode($value));
    }
protected function updateTrackedInfo ( $ session , $ sessionKey , $ trackInfoArray , $ limit = 5 ) { // save the url, controller and action in the session $ value = json_decode ( $ session -> get ( $ sessionKey ) , true ) ; if ( is_null ( $ value ) ) { $ value = [ ] ; } // add new value as first value (to the top of the stack) array_unshift ( $ value , $ trackInfoArray ) ; // remove last value, if array has more than limit items if ( $ limit > 0 and count ( $ value ) > $ limit ) { array_pop ( $ value ) ; } // set the session value $ session -> set ( $ sessionKey , json_encode ( $ value ) ) ; }
update tracker info in session.

@param $session
@param string $sessionKey
@param array  $trackInfoArray
@param int    $limit
update tracker info in session .