2012-12-19 28 views

回答

5

作爲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') 
); 

在上面的代碼,* vendor_code *和* client_code *是複合鍵的組分。

相關問題