squadMemberPins

(/rs/public/functions.php)

squadMemberPins -- Array containing pins of members in a squadron.

Description

array squadMemberPins ($sq_id, $strict = 'no', $officers = 'all', $includeCadets = false)

This function returns an array containing all the pins of members in a given squadron with id $sq_id.

If $strict is set to yes, the keys of the array will denote the position in the squadron. Otherwise, the keys are general integers with no particular meaning.

$officers can be "only" or "all". If set to "only", only the pins of the CO, XO, and SO will be returned. Otherwise, all squad members are returned. If this is set to "only", it will override any value set in $includeCadets.

$includeCadets is boolean. If set to true, cadets are included in the pins of members returned. Otherwise, cadets are omitted. This is the default behavior.

The array returned will contain only positive integers in the case of acting officers (which have negative positions). It is impossible to use this function to determine acting positions.

This function will return an empty array upon failure.

Examples

squadMemberPins (1) /* Returns the pins of members in squad with id 1. Keys are arbitrary, all members are returned except cadets. */

squadMemberPins (1, "yes", "all", true) /* Returns the pins of members in squad with id 1. Keys are the position in the squad. All members, including cadets, are returned. */

squadMemberPins (1, "no", "only") /* Returns the CO, XO, and SO from squad with id 1. Keys are arbitrary. Cadets are returned regardless of the fourth parameter. */

squadMemberPins () /* Returns an empty array */

Related Functions

wingMemberPins, fleetMemberPins, squadMemberSelect

Dependencies

absArray

Function Index