function migrate_example_wine_data_account in Migrate 7.2
Same name and namespace in other branches
- 6.2 migrate_example/wine.install.inc \migrate_example_wine_data_account()
1 call to migrate_example_wine_data_account()
- migrate_example_wine_install in migrate_example/
wine.install.inc
File
- migrate_example/
wine.install.inc, line 1044 - Set up for the wine (advanced) example.
Code
function migrate_example_wine_data_account() {
$fields = array(
'accountid',
'status',
'posted',
'last_access',
'last_login',
'name',
'sex',
'password',
'mail',
'original_mail',
'sig',
'imageid',
'positions',
);
$query = db_insert('migrate_example_wine_account')
->fields($fields);
$data = array(
array(
1,
1,
'2010-03-30 10:31:05',
'2010-04-30 18:25:24',
'2010-04-30 14:01:02',
'darren',
'M',
'dpass',
'ddarren@example.com',
'darren@example.com',
'All about the Australians',
NULL,
'5',
),
array(
3,
0,
'2007-03-15 10:31:05',
'2007-06-10 04:11:38',
'2007-06-10 04:11:38',
'emily',
'F',
'insecure',
'emily@example.com',
'emily@example.com',
'Sommelier to the stars',
NULL,
'18',
),
array(
9,
1,
'2004-02-29 10:31:05',
'2004-02-29 10:31:05',
'2004-02-29 10:31:05',
'fonzie',
NULL,
'bike',
'thefonz@example.com',
'arthur@example.com',
'Aaay!',
1,
'5,18',
),
);
foreach ($data as $row) {
$query
->values(array_combine($fields, $row));
}
$query
->execute();
}