public function DrupalTerm5Migration::prepareRow in Drupal-to-Drupal data migration 7.2
Implementation of Migration::prepareRow().
Parameters
$row:
Overrides DrupalTermMigration::prepareRow
File
- d5/
taxonomy.inc, line 44 - Implementation of DrupalTermMigration for Drupal 5 sources.
Class
- DrupalTerm5Migration
- Handling specific to a Drupal 5 source for taxonomy terms.
Code
public function prepareRow($row) {
if (parent::prepareRow($row) === FALSE) {
return FALSE;
}
// Add the (potentially multiple) parents
$result = Database::getConnection('default', $this->sourceConnection)
->select('term_hierarchy', 'th')
->fields('th', array(
'parent',
))
->condition('tid', $row->tid)
->execute();
foreach ($result as $parent_row) {
$row->parent[] = $parent_row->parent;
}
}