function migrate_example_wine_data_wine in Migrate 7.2
Same name and namespace in other branches
- 6.2 migrate_example/wine.install.inc \migrate_example_wine_data_wine()
1 call to migrate_example_wine_data_wine()
- migrate_example_wine_install in migrate_example/
wine.install.inc
File
- migrate_example/
wine.install.inc, line 969 - Set up for the wine (advanced) example.
Code
function migrate_example_wine_data_wine() {
$fields = array(
'wineid',
'name',
'body',
'excerpt',
'accountid',
'posted',
'last_changed',
'variety',
'region',
'rating',
);
$query = db_insert('migrate_example_wine')
->fields($fields);
$data = array(
array(
1,
'Montes Classic Cabernet Sauvignon',
'Intense ruby-red color',
'Great!',
9,
strtotime('2010-01-02 03:04:05'),
strtotime('2010-03-04 05:06:07'),
25,
17,
95,
),
array(
2,
'Archeo Ruggero di Tasso Nero d\'Avola',
'Lots of berry character',
'Pair with red sauced dishes',
3,
strtotime('2010-09-03 18:23:58'),
strtotime('2010-09-03 18:23:58'),
26,
2,
85,
),
);
foreach ($data as $row) {
$query
->values(array_combine($fields, $row));
}
$query
->execute();
}