public function prepareRow($row) { parent::prepareRow($row); // The more reliable field for relating a data set to its data sources // is actually on the data source itself, linking back to this data set, // rather than the data source reference field on this data set. If this // backreference field has a value, use it instead. $connection = Database::getConnection('default', $this->sourceConnection); if (!$connection->schema()->fieldExists('content_type_data_file', 'field_data_file_data_set_nid')) { $this->queueMessage("No back reference in Deims D6 database", MigrationBase::MESSAGE_INFORMATIONAL); } else { $query = $connection->select('content_type_data_file', 'c'); $query->addField('c', 'nid'); $query->condition('field_data_file_data_set_nid', $row->nid); $query->distinct(); $results = $query->execute()->fetchCol(); if (!empty($results)) { $row->field_dataset_datafile_ref = $results; } } }
public function prepareRow($row) { parent::prepareRow($row); }