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;
    }
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;
    }
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 ; }
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
Creates a map of row keys out of the query select clause that can be used to hydrate nested result sets more quickly .