Skip to main content

This version of the product is no longer supported, and this documentation is no longer updated regularly. See the latest version of this content.Opens in a new tab

Getting the Category ID

The code itself is pretty simple.

First, we get the information we want to store in the cookie, by fetching the first TicketItem object, using the GetAt method, and then getting the object ID of the FilmCategory object it references.

—TicketConfirm.OnPreHTTP—
TicketConfirm.OnPreHTTP
ClassMethod OnPreHTTP() As %Boolean
{
    If $data(%session.Data("Order")) {
        Set ord = ##class(Cinema.TicketOrder).%OpenId(%session.Data("Order"))
        Set itm = ord.Items.GetAt(1)
        Set cat = itm.Show.Film.Category.%Id()

        // ...

    }

    Quit 1
}
FeedbackOpens in a new tab