SoPHIE API Documentation

Group API Documentation

SoPHIE Group API Class

The Group API provides group related functionality within a given
execution context.

Init: $groupApi = $api->get('sophie_group');

Method: $groupApi->getGroupLabels(...)

Get an array of group labels.

The method returns an array of labels of all groups of a session.

Returns Array List of group labels

Method: $groupApi->getEmptyGroupLabels(...)

Get an array of group labels for groups without members.

The method returns an array of labels of groups of a session not containing any members.

Returns Array List of group labels

Method: $groupApi->getGroupMemberCount(...)

Get the number of participants of a group

The method returns an integer number of members in a group in the given context.

Parameters:

  • String $label Group special label to be translated. Defaults to %current%.
  • Array $options Array of options stepgroupLabel and stepgroupLoop for %localGroup%

Returns Array List of group participant labels

Method: $groupApi->getGroupMembers(...)

Get an array of participants within a group.

The method returns an array of participants within a group of a session. The array can be restricted to labels for participants of a specific type by passing an option array with an element typeLabel to the method.

Parameters:

  • String $label Group special label to be translated. Defaults to %current%.
  • Array $options Array of options stepgroupLabel and stepgroupLoop for %localGroup%

Returns Array List of group participant labels

Method: $groupApi->getGroupMemberLabels(...)

Get an array of labels of participants within a group.

The method returns an array of labels of all participants within a group of a session. The array can be restricted to labels for participants of a specific type by passing an option array with an element typeLabel to the method.

Parameters:

  • String $label Group special label to be translated. Defaults to %current%.
  • Array $options Array of options stepgroupLabel and stepgroupLoop for %localGroup%

Returns Array List of group participant labels

Method: $groupApi->getNoneMemberLabels(...)

Get an array of labels for participants which are not in a group.

The method returns an array of labels of participants which are not in a group . The array can be restricted to labels for participants of a specific type by passing an option array with an element typeLabel to the method.

Parameters:

  • String $stepgroupLabel
  • Integer|String $stepgroupLoop

Returns Array List of participant labels

Method: $groupApi->hasGroupMembership(...)

Get if participant is part of a group

The method returns a boolean that is true when a participant is in a group in the given context.

Parameters:

  • String $participantLabel
  • String $stepgroupLabel
  • Integer|String $stepgroupLoop

Returns null|string

Method: $groupApi->getGroupMembership(...)

Get the group label of a participant in a certain context

Get the group label of a participant defaulting to the current in a certain procedural context passing the stepgroupLabel and stepgroupLoop

Parameters:

  • String $participantLabel
  • String $stepgroupLabel
  • Integer|String $stepgroupLoop

Returns null|string

Method: $groupApi->getGroupMembersByType(...)

Get a list of participants for a type in a group

The method returns an array of participant of a certain participant type in a group

Parameters:

  • String $participantTypeLabel
  • String $label Group special label to be translated. Defaults to %current%.
  • Array $options Array of options stepgroupLabel and stepgroupLoop for %localGroup%

Returns Array List of group participant labels

Method: $groupApi->getGroupMemberByType(...)

Get the first participant for a type in a group

The method returns the first participant of a certain participant type in a group

Parameters:

  • String $participantTypeLabel
  • String $label Group special label to be translated. Defaults to %current%.
  • Array $options Array of options stepgroupLabel and stepgroupLoop for %localGroup%

Returns Array List of group participant labels

Method: $groupApi->getGroupMemberLabelsByType(...)

Get a list of participants labels for a type in a group

The method returns an array of participant label of a certain participant type in a group

Parameters:

  • String $participantTypeLabel
  • String $label Group special label to be translated. Defaults to %current%.
  • Array $options Array of options stepgroupLabel and stepgroupLoop for %localGroup%

Returns Array List of group participant labels

Method: $groupApi->getGroupMemberLabelByType(...)

Get the first participant for a type in a group

The method returns the first participant of a certain participant type in a group

Parameters:

  • String $participantTypeLabel
  • String $label Group special label to be translated. Defaults to %current%.
  • Array $options Array of options stepgroupLabel and stepgroupLoop for %localGroup%

Returns Array List of group participant labels

Method: $groupApi->translateLabel(...)

Translates a group special label considering the context into a label of a specific group.

The method supports the special labels %current% and %localGroup%.
%current% translates to the label of the group which is currently active within the current procedural context.
%localGroup% translates to the label of the group for a specified procedural context. The procedural context is defined by passing stepgroupLabel and stepgroupLoop as options in an array as a second parameter to the method.

Parameters:

  • String $label Group special label to be translated. Defaults to %current%.
  • Array $options Array of options stepgroupLabel and stepgroupLoop for %localGroup%

Returns String|null Group label

Method: $groupApi->setGroupMembers(...)

Set group members for a group in the current or a specified procedural context

The method sets group members for a group in the current or a specified procedural context

Parameters:

  • Array $participantLabels Array of participantLabels to set as members of this group
  • String $groupLabel defaults to %current%
  • String $stepgroupLabel defaults to %current%
  • int $stepgroupLoop defaults to %current%

Returns Boolean successfull

Method: $groupApi->addGroupMember(...)

Add group members for the current or a specified procedural context

The method adds group members for the current or a specified procedural context

Parameters:

  • Array $participantLabels Array of participantLabels to set as members of this group
  • String $groupLabel defaults to %current%
  • String $stepgroupLabel defaults to %current%
  • int $stepgroupLoop defaults to %current%

Returns Boolean successfull

Method: $groupApi->addGroupMembers(...)

Add group members for the current or a specified procedural context

The method add group members for the current or a specified procedural context

Parameters:

  • Array $participantLabels Array of participantLabels to set as members of this group
  • String $groupLabel defaults to %current%
  • String $stepgroupLabel defaults to %current%
  • int $stepgroupLoop defaults to %current%

Returns Boolean successfull

Method: $groupApi->removeGroupMember(...)

Remove group member for the current or a specified procedural context

The method removes group member for the current or a specified procedural context

Parameters:

  • String $participantLabel participantLabel of the member to remove from the group
  • String $groupLabel defaults to %current%
  • String $stepgroupLabel defaults to %current%
  • int $stepgroupLoop defaults to %current%

Returns Boolean successfull

Method: $groupApi->removeGroupMembers(...)

Remove group members for the current or a specified procedural context

The method removes group members for the current or a specified procedural context

Parameters:

  • Array $participantLabels Array of participantLabels to set as members of this group
  • String $groupLabel defaults to %current%
  • String $stepgroupLabel defaults to %current%
  • int $stepgroupLoop defaults to %current%

Returns Boolean successfull

Method: $groupApi->unsetGroupMembers(...)

Unsets all current group members for the current or a specified procedural context

The method unsets all current group members for the current or a specified procedural context

Parameters:

  • String $groupLabel defaults to %current%
  • String $stepgroupLabel defaults to %current%
  • int $stepgroupLoop defaults to %current%

Returns Boolean successfull

Method: $groupApi->addGroup(...)

Add a group to the session

The method adds a single group with all participants considering the group structure to the session

Returns Array Containing String of new group label and array with new participant labels

Method: $groupApi->addGroups(...)

Add a number of groups to the session

The method adds a number of groups with all participants considering the group structure to the session

Parameters:

  • int $groupNumber Number if groups to add

Returns array List of new group labels

Method: $groupApi->getGroupStructure(...)

Get the defined group structure

The method returns the defined group structure

Parameters:

  • int $groupNumber Number if groups to add

Returns Boolean successfull

Method: $groupApi->getDefaultGroupStructure(...)

Get the defined default group structure

The method returns the defined default group structure

Parameters:

  • int $groupNumber Number of groups to add

Returns Boolean successfull

Method: $groupApi->setGroupingFromDefinition(...)

Set the grouping from an array based definition structure

The method set the grouping from an array based definition structure

Parameters:

  • Array $groupingDefinition Grouping definition structure

Method: $groupApi->addGroupingFromDefinition(...)

Adds the grouping from an array based definition structure

The method adds the grouping from an array based definition structure

Parameters:

  • Array $groupingDefinition Grouping definition structure

Method: $groupApi->getGroupingDefinition(...)

Return the grouping definition as an array

The method returns the grouping definition as an array

Parameters:

  • String $stepgroupLabel = '%all%'
  • String|int $stepgroupLoop = '%all%'

Returns Array $groupingDefinition Grouping definition structure

Method: $groupApi->setGroupingFromSessiontype(...)

Set the grouping from the associated sessiontype

The method sets the grouping from the associated sessiontype

Method: $groupApi->getDefaultGrouping(...)

Get a default grouping definition structure

The method returns a default grouping definition for one loop

Returns Array $groupingDefinition Grouping definition structure

Method: $groupApi->getRandomGrouping(...)

Get a random grouping definition structure

The method returns a random grouping definition for one loop

Returns Array $groupingDefinition Grouping definition structure

Method: $groupApi->setRandomGrouping(...)

Set the random grouping definition structure

The method sets a random grouping definition structure

Parameters:

  • String $stepgroupLabel = '%current%'
  • String|int $stepgroupLoop = '%current%'

Method: $groupApi->setDefaultGrouping(...)

Set the default grouping definition structure

The method sets a default grouping definition structure

Parameters:

  • String $stepgroupLabel = '%current%'
  • String|int $stepgroupLoop = '%current%'

Method: $groupApi->copyGrouping(...)

Copy the grouping from one stepgroup loop to another

The method copies the grouping from one stepgroup loop to another

Parameters:

  • String $fromStepgroupLabel = '%last%'
  • String|int $fromStepgroupLoop = '%last%'
  • String $stepgroupLabel = '%current%'
  • String|int $stepgroupLoop = '%current%'