HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.2.34
System: Linux atalantini.com 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64
User: root (0)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: /var/www/html/coreplad/sites/all/modules/entityreference/entityreference.migrate.inc
<?php
/**
 * @file
 * Support for processing entity reference fields in Migrate.
 */

/**
 * Implements hook_migrate_api().
 */
function entityreference_migrate_api() {
  return array(
    'api' => 2,
    'field handlers' => array('MigrateEntityReferenceFieldHandler'),
  );
}

/**
 * Extended class for handling entityreference fields.
 */
class MigrateEntityReferenceFieldHandler extends MigrateSimpleFieldHandler {

  /**
   * Constructor.
   */
  public function __construct() {
    parent::__construct(array(
      'value_key' => 'target_id',
      'skip_empty' => TRUE,
    ));

    $this->registerTypes(array('entityreference'));
  }
}