Habari\Session::add_to_set PHP Метод

add_to_set() публичный статический Метод

Adds a value to a session set
public static add_to_set ( string $set, mixed $value, string $key = null )
$set string Name of the set
$value mixed value to store
$key string Optional unique key for the set under which to store the value
    public static function add_to_set($set, $value, $key = null)
    {
        if (!isset($_SESSION[$set])) {
            $_SESSION[$set] = array();
        }
        if ($key) {
            $_SESSION[$set][$key] = $value;
        } else {
            $_SESSION[$set][] = $value;
        }
    }