You are here

protected function MigrateSourceReference::_constructRow in Relation 7

Same name and namespace in other branches
  1. 8.2 relation_migrate/relation_migrate.source.inc \MigrateSourceReference::_constructRow()
  2. 8 relation_migrate/relation_migrate.source.inc \MigrateSourceReference::_constructRow()

Constructs row object, that should be returned from $this->getNextRow().

Parameters

stdClass $item Row item as returned from DB.:

string $destination_type Destiantion entity type.:

string $field_name Field's machine name.:

4 calls to MigrateSourceReference::_constructRow()
MigrateSourceEntityReference::getNextRow in relation_migrate/relation_migrate.source.inc
Fetch the next row of data, returning it as an object. Return FALSE when there is no more data available.
MigrateSourceNodeReference::getNextRow in relation_migrate/relation_migrate.source.inc
Fetch the next row of data, returning it as an object. Return FALSE when there is no more data available.
MigrateSourceTermReference::getNextRow in relation_migrate/relation_migrate.source.inc
Fetch the next row of data, returning it as an object. Return FALSE when there is no more data available.
MigrateSourceUserReference::getNextRow in relation_migrate/relation_migrate.source.inc
Fetch the next row of data, returning it as an object. Return FALSE when there is no more data available.

File

relation_migrate/relation_migrate.source.inc, line 107
Source plugin for *reference fields.

Class

MigrateSourceReference
Migration source for *ference field. This source is primary used in relation_migrate to convert *reference entries into relation entities.

Code

protected function _constructRow(stdClass $item, $destination_type, $field_name) {
  $field_info = field_info_field($field_name);
  $columns = array_keys($field_info['columns']);
  $id_key = $field_name . '_' . $columns[0];
  $ret = array(
    'source_type' => $item->entity_type,
    'source_id' => $item->entity_id,
    'destination_type' => $destination_type,
    'destination_id' => $item->{$id_key},
    'field_name' => $field_name,
    'delta' => $item->delta,
  );
  return (object) $ret;
}