private function createDataTableMapFromIndex($index, $resultIndices, $keyMetadata)
    {
        $result = new DataTable\Map();
        $result->setKeyName(reset($resultIndices));
        $resultIndex = key($resultIndices);

        array_shift($resultIndices);

        $hasIndices = !empty($resultIndices);

        foreach ($index as $label => $value) {
            $keyMetadata[$resultIndex] = $this->createTableIndexMetadata($resultIndex, $label);

            if ($hasIndices) {
                $newTable = $this->createDataTableMapFromIndex($value, $resultIndices, $keyMetadata);
            } else {
                $newTable = $this->createDataTable($value, $keyMetadata);
            }

            $result->addTable($newTable, $this->prettifyIndexLabel($resultIndex, $label));
        }

        return $result;
    }
private function createDataTableMapFromIndex($index, $resultIndices, $keyMetadata)
    {
        $result = new DataTable\Map();
        $result->setKeyName(reset($resultIndices));
        $resultIndex = key($resultIndices);

        array_shift($resultIndices);

        $hasIndices = !empty($resultIndices);

        foreach ($index as $label => $value) {
            $keyMetadata[$resultIndex] = $this->createTableIndexMetadata($resultIndex, $label);

            if ($hasIndices) {
                $newTable = $this->createDataTableMapFromIndex($value, $resultIndices, $keyMetadata);
            } else {
                $newTable = $this->createDataTable($value, $keyMetadata);
            }

            $result->addTable($newTable, $this->prettifyIndexLabel($resultIndex, $label));
        }

        return $result;
    }
private function createDataTableMapFromIndex ( $ index , $ resultIndices , $ keyMetadata ) { $ result = new DataTable \ Map ( ) ; $ result -> setKeyName ( reset ( $ resultIndices ) ) ; $ resultIndex = key ( $ resultIndices ) ; array_shift ( $ resultIndices ) ; $ hasIndices = ! empty ( $ resultIndices ) ; foreach ( $ index as $ label => $ value ) { $ keyMetadata [ $ resultIndex ] = $ this -> createTableIndexMetadata ( $ resultIndex , $ label ) ; if ( $ hasIndices ) { $ newTable = $ this -> createDataTableMapFromIndex ( $ value , $ resultIndices , $ keyMetadata ) ; } else { $ newTable = $ this -> createDataTable ( $ value , $ keyMetadata ) ; } $ result -> addTable ( $ newTable , $ this -> prettifyIndexLabel ( $ resultIndex , $ label ) ) ; } return $ result ; }
Creates a Set from an array index.

@param array $index @see DataCollection
@param array $resultIndices @see make
@param array $keyMetadata The metadata to add to the table when it's created.
@return DataTable\Map
Creates a Set from an array index .