original_string: protected function buildArrayFromMappingCollection(MappingCollection $mappingCollection)
      {
          $return = [];
  
          /** @var $mappingInformation Mapping */
          foreach ($mappingCollection as $mappingInformation) {
              $indexName = $mappingInformation->getType()->getIndex()->getName();
              $typeName = $mappingInformation->getType()->getName();
              if (isset($return[$indexName][$typeName])) {
                  throw new ElasticSearchException('There was more than one mapping present in index %s with type %s, which must not happen.', 1339758480);
              }
  
              $return[$indexName][$typeName]['mappingInstance'] = $mappingInformation;
              $return[$indexName][$typeName]['properties'] = $mappingInformation->getProperties();
          }
  
          return $return;
      }
code: protected function buildArrayFromMappingCollection(MappingCollection $mappingCollection)
      {
          $return = [];
  
          /** @var $mappingInformation Mapping */
          foreach ($mappingCollection as $mappingInformation) {
              $indexName = $mappingInformation->getType()->getIndex()->getName();
              $typeName = $mappingInformation->getType()->getName();
              if (isset($return[$indexName][$typeName])) {
                  throw new ElasticSearchException('There was more than one mapping present in index %s with type %s, which must not happen.', 1339758480);
              }
  
              $return[$indexName][$typeName]['mappingInstance'] = $mappingInformation;
              $return[$indexName][$typeName]['properties'] = $mappingInformation->getProperties();
          }
  
          return $return;
      }
code_tokens: protected function buildArrayFromMappingCollection ( MappingCollection $ mappingCollection ) { $ return = [ ] ; /** @var $mappingInformation Mapping */ foreach ( $ mappingCollection as $ mappingInformation ) { $ indexName = $ mappingInformation -> getType ( ) -> getIndex ( ) -> getName ( ) ; $ typeName = $ mappingInformation -> getType ( ) -> getName ( ) ; if ( isset ( $ return [ $ indexName ] [ $ typeName ] ) ) { throw new ElasticSearchException ( 'There was more than one mapping present in index %s with type %s, which must not happen.' , 1339758480 ) ; } $ return [ $ indexName ] [ $ typeName ] [ 'mappingInstance' ] = $ mappingInformation ; $ return [ $ indexName ] [ $ typeName ] [ 'properties' ] = $ mappingInformation -> getProperties ( ) ; } return $ return ; }
docstring: Traverses through mappingInformation array and aggregates by index and type names
  
  @param MappingCollection $mappingCollection
  @throws ElasticSearchException
  @return array with index names as keys, second level type names as keys
docstring_tokens: Traverses through mappingInformation array and aggregates by index and type names