You are here

function migrate_example_wine_data_variety_updates in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 migrate_example/wine.install.inc \migrate_example_wine_data_variety_updates()
1 call to migrate_example_wine_data_variety_updates()
migrate_example_wine_install in migrate_example/wine.install.inc

File

migrate_example/wine.install.inc, line 1313
Set up for the wine (advanced) example.

Code

function migrate_example_wine_data_variety_updates() {
  $fields = array(
    'categoryid',
    'details',
  );
  $query = db_insert('migrate_example_wine_variety_updates')
    ->fields($fields);
  $data = array(
    array(
      1,
      'White wines are simpler and sweeter than red',
    ),
    array(
      3,
      'Red wines are generally more complex and dry than white',
    ),
    array(
      8,
      'Usually associated with Germany',
    ),
    array(
      9,
      NULL,
    ),
    array(
      13,
      'Common, very drinakable',
    ),
    array(
      14,
      'AKA Shiraz',
    ),
    array(
      25,
      'Basic',
    ),
    array(
      26,
      'A specialty of Sicily',
    ),
  );
  foreach ($data as $row) {
    $query
      ->values(array_combine($fields, $row));
  }
  $query
    ->execute();
}