entityreference.migrate.inc 643 B

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