Networking\InitCmsBundle\EventListener\AdminTrackerListener::updateTrackedInfo PHP Метод

updateTrackedInfo() защищенный Метод

update tracker info in session
protected updateTrackedInfo ( $session, string $sessionKey, array $trackInfoArray, integer $limit = 5 )
$session
$sessionKey string
$trackInfoArray array
$limit integer
    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 = array();
        }
        // 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));
    }