class MigrateSourceEntityReference in Relation 8
Same name and namespace in other branches
- 8.2 relation_migrate/relation_migrate.source.inc \MigrateSourceEntityReference
- 7 relation_migrate/relation_migrate.source.inc \MigrateSourceEntityReference
Source migration plugin for entityreference.
Hierarchy
- class \MigrateSourceReference extends \MigrateSource
- class \MigrateSourceEntityReference
Expanded class hierarchy of MigrateSourceEntityReference
File
- relation_migrate/
relation_migrate.source.inc, line 135 - Source plugin for *reference fields.
View source
class MigrateSourceEntityReference extends MigrateSourceReference {
/**
* Constructor.
*
* @param array $fields
* List of fields to be migrated.
*/
function __construct(array $fields, array $options = array()) {
parent::__construct('entityreference', $fields, $options);
}
/**
* Fetch the next row of data, returning it as an object. Return FALSE
* when there is no more data available.
*/
public function getNextRow() {
if (!empty($this->result[$this->next_row])) {
$item = $this->result[$this->next_row];
$dest_type = field_read_field($item->field_name);
$this->next_row++;
return $this
->_constructRow($item, $dest_type['settings']['target_type'], $item->field_name);
}
return FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MigrateSourceEntityReference:: |
public | function | Fetch the next row of data, returning it as an object. Return FALSE when there is no more data available. | |
MigrateSourceEntityReference:: |
function |
Constructor. Overrides MigrateSourceReference:: |
||
MigrateSourceReference:: |
protected | property | Machine names of fields that will be imported. | |
MigrateSourceReference:: |
protected | property | Field type. | |
MigrateSourceReference:: |
protected | property | ID of a row, that will be imported during next iteration. | |
MigrateSourceReference:: |
protected | property | Place where data is stored during import. | |
MigrateSourceReference:: |
public | function | Return the number of available source records. | |
MigrateSourceReference:: |
public | function | Returns a list of fields available to be mapped from the source, keyed by field name. | |
MigrateSourceReference:: |
public | function | Do whatever needs to be done to start a fresh traversal of the source data. | |
MigrateSourceReference:: |
protected | function | Constructs row object, that should be returned from $this->getNextRow(). | |
MigrateSourceReference:: |
public | function | Return a string representing the source, for display in the UI. |