entityreference.migrate.inc 549 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * @file
  4. * Support for processing entity reference fields in Migrate.
  5. */
  6. /**
  7. * Implement hook_migrate_api().
  8. */
  9. function entityreference_migrate_api() {
  10. return array(
  11. 'api' => 2,
  12. 'field handlers' => array('MigrateEntityReferenceFieldHandler'),
  13. );
  14. }
  15. class MigrateEntityReferenceFieldHandler extends MigrateSimpleFieldHandler {
  16. public function __construct() {
  17. parent::__construct(array(
  18. 'value_key' => 'target_id',
  19. 'skip_empty' => TRUE,
  20. ));
  21. $this->registerTypes(array('entityreference'));
  22. }
  23. }