21. 亊从 于仂亳亳 仄亞舒? 21
brand.inc 舒仗仆亞 仗仂仍于
$this->addFieldMapping('name', 'name')
->description(t('The incoming name(source) field is the name of the term'));
$this->addFieldMapping('format')
->issueGroup(t('DNM'));
$this->addFieldMapping('weight')
->issueGroup(t('DNM'));
22. 亊从 于仂亳亳 仄亞舒?
<?php
class BrandMigration extends Migration {
public function __construct() {
parent::__construct();
$this->description = t('Migrate car brands from the source database to taxonomy terms');
$source_key_schema = array(
'id_car_mark' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
)
);
$this->map = new MigrateSQLMap($this->machineName, $source_key_schema,
MigrateDestinationTerm::getKeySchema());
$query = db_select('car_mark', 'mark')
->fields('mark', array('id_car_mark', 'name'))
$this->source = new MigrateSourceSQL($query);
$this->destination = new MigrateDestinationTerm('brands');
$this->addFieldMapping('name', 'name')
->description(t('The incoming name(source) field is the name of the term parent'));
$this->addFieldMapping('description')
->issueGroup(t('DNM'));
}
}
22
brand.inc
23. 仂亟舒从仂于 仄亠仂亟亳 23
brand.inc
function prepareRow($row)
function prepare($entity, stdClass $row)
function complete($entity, stdClass $row)