You are here

function migrate_example_wine_data_producer in Migrate 7.2

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

File

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

Code

function migrate_example_wine_data_producer() {
  $fields = array(
    'producerid',
    'name',
    'body',
    'excerpt',
    'accountid',
  );
  $query = db_insert('migrate_example_wine_producer')
    ->fields($fields);
  $data = array(
    array(
      1,
      'Montes',
      'Fine Chilean winery',
      'Great!',
      9,
    ),
    array(
      2,
      'Archeo',
      'Sicilia!',
      NULL,
      3,
    ),
  );
  foreach ($data as $row) {
    $query
      ->values(array_combine($fields, $row));
  }
  $query
    ->execute();
}