当MigrateSQLMap采用数组时,您可以在源定义中设置多个字段:
// The source ID here is the one retrieved from each data item in the XML file, and
// used to identify specific items
$this->map = new MigrateSQLMap($this->machineName,
array(
'vendor_code' => array(
'type' => 'varchar',
'length' => 250,
'not null' => TRUE,
),
'client_code' => array(
'type' => 'varchar',
'length' => 250,
'not null' => TRUE,
),
),
MigrateDestinationEntityAPI::getKeySchema('vendor')
);
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,*vendor_code*和*client_code*是组合键的组件.
| 归档时间: |
|
| 查看次数: |
1687 次 |
| 最近记录: |