original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Creates a Set from an array index .