function migrate_example_wine_data_comment_updates in Migrate 7.2
Same name and namespace in other branches
- 6.2 migrate_example/wine.install.inc \migrate_example_wine_data_comment_updates()
1 call to migrate_example_wine_data_comment_updates()
- migrate_example_wine_install in migrate_example/
wine.install.inc
File
- migrate_example/
wine.install.inc, line 1225 - Set up for the wine (advanced) example.
Code
function migrate_example_wine_data_comment_updates() {
$fields = array(
'commentid',
'subject',
);
$query = db_insert('migrate_example_wine_comment_updates')
->fields($fields);
$data = array(
array(
1,
'I am first',
),
array(
2,
'I am second',
),
array(
3,
'I am parent',
),
array(
4,
'',
),
array(
5,
'I am Spartacus',
),
);
foreach ($data as $row) {
$query
->values(array_combine($fields, $row));
}
$query
->execute();
}