public function castUsersTable(TableNode $user_table) {
    $aliases = array(
      'country' => 'field_post_address:country',
      'city' => 'field_post_address:locality',
      'street' => 'field_post_address:thoroughfare',
      'postcode' => 'field_post_address:postal_code',
    );

    // The first row of the table contains the field names.
    $table = $user_table->getTable();
    reset($table);
    $first_row = key($table);

    // Replace the aliased field names with the actual ones.
    foreach ($table[$first_row] as $key => $alias) {
      if (array_key_exists($alias, $aliases)) {
        $table[$first_row][$key] = $aliases[$alias];
      }
    }

    return new TableNode($table);
  }
public function castUsersTable(TableNode $user_table) {
    $aliases = array(
      'country' => 'field_post_address:country',
      'city' => 'field_post_address:locality',
      'street' => 'field_post_address:thoroughfare',
      'postcode' => 'field_post_address:postal_code',
    );

    // The first row of the table contains the field names.
    $table = $user_table->getTable();
    reset($table);
    $first_row = key($table);

    // Replace the aliased field names with the actual ones.
    foreach ($table[$first_row] as $key => $alias) {
      if (array_key_exists($alias, $aliases)) {
        $table[$first_row][$key] = $aliases[$alias];
      }
    }

    return new TableNode($table);
  }
public function castUsersTable ( TableNode $ user_table ) { $ aliases = array ( 'country' => 'field_post_address:country' , 'city' => 'field_post_address:locality' , 'street' => 'field_post_address:thoroughfare' , 'postcode' => 'field_post_address:postal_code' , ) ; // The first row of the table contains the field names. $ table = $ user_table -> getTable ( ) ; reset ( $ table ) ; $ first_row = key ( $ table ) ; // Replace the aliased field names with the actual ones. foreach ( $ table [ $ first_row ] as $ key => $ alias ) { if ( array_key_exists ( $ alias , $ aliases ) ) { $ table [ $ first_row ] [ $ key ] = $ aliases [ $ alias ] ; } } return new TableNode ( $ table ) ; }
Transforms long address field columns into shorter aliases.

This is used in field_handlers.feature for testing if lengthy field:column
combinations can be shortened to more human friendly aliases.

@Transform table:name,mail,street,city,postcode,country
Transforms long address field columns into shorter aliases .