public static function filterCellData($observationsList, $filterData, $allDelimiter = '|')
    {
        //if the cell content is not an array with multiple entries, do not filter
        if (!is_array($observationsList)) {
            return $observationsList;
        }

        // Sort by TimeStamps
        uksort($observationsList, "oat\\taoOutcomeUi\\model\\ResultsService::sortTimeStamps");

        // Extract the value to make this array flat
        $observationsList = array_map(function($obs) {
            return $obs[0];
        }, $observationsList);

        switch ($filterData) {

            case self::VARIABLES_FILTER_LAST_SUBMITTED:
                $value = array_pop($observationsList);
            break;

            case self::VARIABLES_FILTER_FIRST_SUBMITTED:
                $value = array_shift($observationsList);
            break;

            case self::VARIABLES_FILTER_ALL:
            default:
                $value = implode($allDelimiter, $observationsList);
            break;
        }

        return [$value];
    }
public static function filterCellData($observationsList, $filterData, $allDelimiter = '|')
    {
        //if the cell content is not an array with multiple entries, do not filter
        if (!is_array($observationsList)) {
            return $observationsList;
        }

        // Sort by TimeStamps
        uksort($observationsList, "oat\\taoOutcomeUi\\model\\ResultsService::sortTimeStamps");

        // Extract the value to make this array flat
        $observationsList = array_map(function($obs) {
            return $obs[0];
        }, $observationsList);

        switch ($filterData) {

            case self::VARIABLES_FILTER_LAST_SUBMITTED:
                $value = array_pop($observationsList);
            break;

            case self::VARIABLES_FILTER_FIRST_SUBMITTED:
                $value = array_shift($observationsList);
            break;

            case self::VARIABLES_FILTER_ALL:
            default:
                $value = implode($allDelimiter, $observationsList);
            break;
        }

        return [$value];
    }
public static function filterCellData ( $ observationsList , $ filterData , $ allDelimiter = '|' ) { //if the cell content is not an array with multiple entries, do not filter if ( ! is_array ( $ observationsList ) ) { return $ observationsList ; } // Sort by TimeStamps uksort ( $ observationsList , "oat\\taoOutcomeUi\\model\\ResultsService::sortTimeStamps" ) ; // Extract the value to make this array flat $ observationsList = array_map ( function ( $ obs ) { return $ obs [ 0 ] ; } , $ observationsList ) ; switch ( $ filterData ) { case self :: VARIABLES_FILTER_LAST_SUBMITTED : $ value = array_pop ( $ observationsList ) ; break ; case self :: VARIABLES_FILTER_FIRST_SUBMITTED : $ value = array_shift ( $ observationsList ) ; break ; case self :: VARIABLES_FILTER_ALL : default : $ value = implode ( $ allDelimiter , $ observationsList ) ; break ; } return [ $ value ] ; }
Sort the list of variables by filters

List of variables contains the response for an interaction.
Each attempts is an entry in $observationList

3 allowed filters: firstSubmitted, lastSubmitted, all

@param array $observationsList The list of variable values
@param string $filterData The filter
@param string $allDelimiter $delimiter to separate values in "all" filter context
@return array
Sort the list of variables by filters