original_string: protected function _getTypes($table, $fields)
      {
          $types = [];
          $schema = $table->getSchema();
          $map = array_keys((array)Type::getMap() + ['string' => 1, 'text' => 1, 'boolean' => 1]);
          $typeMap = array_combine(
              $map,
              array_map(['Cake\Database\Type', 'build'], $map)
          );
  
          foreach (['string', 'text'] as $t) {
              if (get_class($typeMap[$t]) === 'Cake\Database\Type') {
                  unset($typeMap[$t]);
              }
          }
  
          foreach (array_intersect($fields, $schema->columns()) as $col) {
              $typeName = $schema->getColumnType($col);
              if (isset($typeMap[$typeName])) {
                  $types[$col] = $typeMap[$typeName];
              }
          }
  
          return $types;
      }
code: protected function _getTypes($table, $fields)
      {
          $types = [];
          $schema = $table->getSchema();
          $map = array_keys((array)Type::getMap() + ['string' => 1, 'text' => 1, 'boolean' => 1]);
          $typeMap = array_combine(
              $map,
              array_map(['Cake\Database\Type', 'build'], $map)
          );
  
          foreach (['string', 'text'] as $t) {
              if (get_class($typeMap[$t]) === 'Cake\Database\Type') {
                  unset($typeMap[$t]);
              }
          }
  
          foreach (array_intersect($fields, $schema->columns()) as $col) {
              $typeName = $schema->getColumnType($col);
              if (isset($typeMap[$typeName])) {
                  $types[$col] = $typeMap[$typeName];
              }
          }
  
          return $types;
      }
code_tokens: protected function _getTypes ( $ table , $ fields ) { $ types = [ ] ; $ schema = $ table -> getSchema ( ) ; $ map = array_keys ( ( array ) Type :: getMap ( ) + [ 'string' => 1 , 'text' => 1 , 'boolean' => 1 ] ) ; $ typeMap = array_combine ( $ map , array_map ( [ 'Cake\Database\Type' , 'build' ] , $ map ) ) ; foreach ( [ 'string' , 'text' ] as $ t ) { if ( get_class ( $ typeMap [ $ t ] ) === 'Cake\Database\Type' ) { unset ( $ typeMap [ $ t ] ) ; } } foreach ( array_intersect ( $ fields , $ schema -> columns ( ) ) as $ col ) { $ typeName = $ schema -> getColumnType ( $ col ) ; if ( isset ( $ typeMap [ $ typeName ] ) ) { $ types [ $ col ] = $ typeMap [ $ typeName ] ; } } return $ types ; }
docstring: Returns the Type classes for each of the passed fields belonging to the
  table.
  
  @param \Cake\ORM\Table $table The table from which to get the schema
  @param array $fields The fields whitelist to use for fields in the schema.
  @return array
docstring_tokens: Returns the Type classes for each of the passed fields belonging to the table .