Basket::erase PHP Method

erase() public method

Erase item matching key/value pair
public erase ( $key, $val ) : boolean
$key string
$val mixed
return boolean
    function erase($key, $val)
    {
        $found = $this->find($key, $val);
        if ($found && ($id = $found[0]->id)) {
            unset($_SESSION[$this->key][$id]);
            if ($id == $this->id) {
                $this->reset();
            }
            return TRUE;
        }
        return FALSE;
    }