Fusio

API / $context

The context contains all information about the incoming request which is not HTTP related i.e. it contains the authenticated user and app or also the route id which was used

Methods
Name Description
getRouteId Returns the id of the route
getBaseUrl Returns the base url of the system to generate i.e. HATEOAS links. The url has a trailing slash
getApp Returns the app which was used for this request. Can also be an anonymous app if authorization is not required for the endpoint
getUser Returns the user which has authenticated through the app. Can also be an anonymous user if authorization is not required for the endpoint
getAction Returns the current action
withAction Creates a new context containing the given action
getConnection Returns the connection which is currently used by the action
withConnection Sets the currently used connection