original_string: protected function _calculateColumnMap($query)
      {
          $map = [];
          foreach ($query->clause('select') as $key => $field) {
              $key = trim($key, '"`[]');
  
              if (strpos($key, '__') <= 0) {
                  $map[$this->_defaultAlias][$key] = $key;
                  continue;
              }
  
              $parts = explode('__', $key, 2);
              $map[$parts[0]][$key] = $parts[1];
          }
  
          foreach ($this->_matchingMap as $alias => $assoc) {
              if (!isset($map[$alias])) {
                  continue;
              }
              $this->_matchingMapColumns[$alias] = $map[$alias];
              unset($map[$alias]);
          }
  
          $this->_map = $map;
      }
code: protected function _calculateColumnMap($query)
      {
          $map = [];
          foreach ($query->clause('select') as $key => $field) {
              $key = trim($key, '"`[]');
  
              if (strpos($key, '__') <= 0) {
                  $map[$this->_defaultAlias][$key] = $key;
                  continue;
              }
  
              $parts = explode('__', $key, 2);
              $map[$parts[0]][$key] = $parts[1];
          }
  
          foreach ($this->_matchingMap as $alias => $assoc) {
              if (!isset($map[$alias])) {
                  continue;
              }
              $this->_matchingMapColumns[$alias] = $map[$alias];
              unset($map[$alias]);
          }
  
          $this->_map = $map;
      }
code_tokens: protected function _calculateColumnMap ( $ query ) { $ map = [ ] ; foreach ( $ query -> clause ( 'select' ) as $ key => $ field ) { $ key = trim ( $ key , '"`[]' ) ; if ( strpos ( $ key , '__' ) <= 0 ) { $ map [ $ this -> _defaultAlias ] [ $ key ] = $ key ; continue ; } $ parts = explode ( '__' , $ key , 2 ) ; $ map [ $ parts [ 0 ] ] [ $ key ] = $ parts [ 1 ] ; } foreach ( $ this -> _matchingMap as $ alias => $ assoc ) { if ( ! isset ( $ map [ $ alias ] ) ) { continue ; } $ this -> _matchingMapColumns [ $ alias ] = $ map [ $ alias ] ; unset ( $ map [ $ alias ] ) ; } $ this -> _map = $ map ; }
docstring: Creates a map of row keys out of the query select clause that can be
  used to hydrate nested result sets more quickly.
  
  @param \Cake\ORM\Query $query The query from where to derive the column map
  @return void
docstring_tokens: Creates a map of row keys out of the query select clause that can be used to hydrate nested result sets more quickly .