Guest User

Untitled

a guest
May 26th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. class totoMigration extends Migration {
  2. public function __construct() {
  3. $this->source = new MigrateSourceCSV('/home/web/dallozformation_imports/toto.csv', array('titre', 'code', 'texte'));
  4. $this->destination = new MigrateDestinationNode('toto_node_type');
  5. $this->map = new MigrateSQLMap(
  6. $this->machineName,
  7. array(
  8. 'code' => array(
  9. 'type' => 'varchar',
  10. 'size' => 'normal'
  11. )
  12. ),
  13. MigrateDestinationNode::getKeySchema()
  14. );
  15.  
  16. $this->addFieldMapping('titre', 'title');
  17. $this->addFieldMapping('code', 'field_toto_code');
  18. $this->addFieldMapping('texte', 'field_toto_texte');
  19. }
  20.  
  21. public function prepareRow($values) {
  22. $values->texte = strtoupper($values->texte);
  23. }
  24. }
Add Comment
Please, Sign In to add comment