SoPHIE API Documentation

Variablequery API Documentation

SoPHIE Labs Variable Query API Class
The Variable Query API provides methods to select one or multiple values from the SoPHIE's variable system

Init: $variablequeryApi = $api->get('sophielabs_variablequery');

Method: $variablequeryApi->fetchRowsPSL(...)

Returns an array of variable information with value and context filtered by the given parameters including the value of the variable and its context information.

Variables can be filtered by Participant Label, Stepgroup Label, Stepgroup Loop and Values.
If any of these parameters is empty, no filter is applied for this parameter.

Parameters:

  • Array|String $names the name of the variable that is searched
  • String $participantLabel the label of the participant that is searched for
  • String $stepgroupLabel the label of the stepgroup that is searched for
  • Array|String $values the value of the variables that is searched for

Returns Array variables with information about name, value and context

Method: $variablequeryApi->fetchParticipantLabelsForPSL(...)

Returns an array of participant labels having variables or variable with specific values in a given participant context.

Variables can be filtered by Participant Label, Stepgroup Label, Stepgroup Loop as well as the Value.
If any of these parameters is empty, no filter is applied for this parameter.

Parameters:

  • Array|String $names the name of the variable that is searched
  • String $participantLabel the label of the participant that is searched for
  • String $stepgroupLabel the label of the stepgroup that is searched for
  • Array|String $values the value of the variables that is searched for

Returns Array participant labels

Method: $variablequeryApi->fetchPSL(...)

Returns an array of variable values in a given participant context.

Variables can be filtered by Participant Label, Stepgroup Label and Stepgroup Loop.
If any of these parameters is empty, no filter is applied for this parameter.

Parameters:

  • Array|String $names the name of the variable that is searched
  • String $participantLabel the label of the participant that is searched for
  • String $stepgroupLabel the label of the stepgroup that is searched for

Returns Array variable values

Method: $variablequeryApi->countPSL(...)

Returns the number of occurences of a variable and a specific variable value in a given participant context.

Variables can be filtered by Participant Label, Stepgroup Label and Stepgroup Loop.
If any of these parameters is empty, no filter is applied for this parameter.

Parameters:

  • Array|String $names the name of the variable that is searched
  • String $participantLabel the label of the participant that is searched for
  • String $stepgroupLabel the label of the stepgroup that is searched for

Returns Int Number of occurences

Method: $variablequeryApi->fetchRowsGSL(...)

Returns an array of variable information with value and context filtered by the given parameters including the value of the variable and its context information.

Variables can be filtered by Group Label, Stepgroup Label, Stepgroup Loop and Values.
If any of these parameters is empty, no filter is applied for this parameter.

Parameters:

  • Array|String $names the name of the variable that is searched
  • String $groupLabel the label of the group that is searched for
  • String $stepgroupLabel the label of the stepgroup that is searched for
  • Array|String $values the value of the variables that is searched for

Returns Array variables with information about name, value and context

Method: $variablequeryApi->fetchGroupLabelsForGSL(...)

Returns an array of group labels having variables or variable with specific values in a given group context.

Variables can be filtered by Group Label, Stepgroup Label, Stepgroup Loop as well as the Value.
If any of these parameters is empty, no filter is applied for this parameter.

Parameters:

  • Array|String $names the name of the variable that is searched
  • String $groupLabel the label of the group that is searched for
  • String $stepgroupLabel the label of the stepgroup that is searched for
  • Array|String $values the value of the variables that is searched for

Returns Array group labels

Method: $variablequeryApi->fetchGSL(...)

Returns an array of variable values in a given group context.

Variables can be filtered by Group Label, Stepgroup Label and Stepgroup Loop.
If any of these parameters is empty, no filter is applied for this parameter.

Parameters:

  • Array|String $names the name of the variable that is searched
  • String $groupLabel the label of the group that is searched for
  • String $stepgroupLabel the label of the stepgroup that is searched for

Returns Array variable values

Method: $variablequeryApi->countGSL(...)

Returns the number of occurences of a variable and specific variable values in a given group context.

Variables can be filtered by Group Label, Stepgroup Label and Stepgroup Loop.
If any of these parameters is empty, no filter is applied for this parameter.

Parameters:

  • Array|String $names the name of the variable that is searched
  • String $groupLabel the label of the participant that is searched for
  • String $stepgroupLabel the label of the stepgroup that is searched for

Returns Int number of occurences