Context API Documentation
SoPHIE Context API Class
The Context API allows access to all parameters defining the
context within which SoPHIE runs steps. It is used throughout
the steptypes and within the rendering engine and scripting
engine to provide a unified interface for all parts interaction
with the context.
Init: $contextApi = $api->get('sophie_context');
Method: $context->getChecksum(...)
Return a string that is used to uniquely identify the current procedural context.
Returns String
Method: $context->getTreatment(...)
Get details for the treatment used within the current context. The function returns an array of raw database entry values.
Returns Array
Method: $context->getTreatmentAttributes(...)
Get treatment attributes used within the current context. The function returns an associative array of all values.
Returns Array
Method: $context->getStepgroupLabel(...)
Returns the current stepgroup label of the context.
Returns String
Method: $context->getStepgroupLoop(...)
Returns the current stepgroup loop of the context.
Returns Integer
Method: $context->getStepLabel(...)
Returns the current step label of the context.
Returns String
Method: $context->getParticipantLabel(...)
Returns the current participant label of the context.
Returns String
Method: $context->getGroupLabel(...)
Returns the current group label of the context.
Returns String
Method: $context->getExperiment(...)
Get details for the experiment used within the current context. The function returns an array of raw database entry values.
Returns Array
Method: $context->getStepgroup(...)
Get details for the stepgroup used within the current context. The function returns an array of raw database entry values.
Returns Array
Method: $context->getStep(...)
Get details for the step used within the current context. The function returns an array of raw database entry values.
Returns Array
Method: $context->getSession(...)
Get details for the session used within the current context. The function returns an array of raw database entry values.
Returns Array
Method: $context->getSessionAttributes(...)
Get session attributes used within the current context. The function returns an associative array of all values.
Returns Array
Method: $context->getSessiontype(...)
Get details for the sessiontype used within the current context. The function returns an array of raw database entry values.
Returns Array
Method: $context->getParticipantTypeLabel(...)
Returns the current participant type label of the context.
Returns String
Method: $context->getParticipant(...)
Get details for the participant used within the current context. The function returns an array of raw database entry values.
Returns Array
Method: $context->getFrontUrl(...)
Get url of frontend.
Returns String
Method: $context->isPreview(...)
Determine whether the current context is called from a running session or as for a preview.
Returns Boolean