Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class totoMigration extends Migration {
- public function __construct() {
- $this->source = new MigrateSourceCSV('/home/web/dallozformation_imports/toto.csv', array('titre', 'code', 'texte'));
- $this->destination = new MigrateDestinationNode('toto_node_type');
- $this->map = new MigrateSQLMap(
- $this->machineName,
- array(
- 'code' => array(
- 'type' => 'varchar',
- 'size' => 'normal'
- )
- ),
- MigrateDestinationNode::getKeySchema()
- );
- $this->addFieldMapping('titre', 'title');
- $this->addFieldMapping('code', 'field_toto_code');
- $this->addFieldMapping('texte', 'field_toto_texte');
- }
- public function prepareRow($values) {
- $values->texte = strtoupper($values->texte);
- }
- }
Add Comment
Please, Sign In to add comment