Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TermNode.php

function TermNode::prepareRow

Overrides SourcePluginBase::prepareRow

File

core/modules/taxonomy/src/Plugin/migrate/source/d6/TermNode.php, line 73

Class

TermNode
Drupal 6 term/node relationships (current revision) source from database.

Namespace

Drupal\taxonomy\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {
    // Select the terms belonging to the revision selected.
    $query = $this->select('term_node', 'tn')
        ->fields('tn', [
        'tid',
    ])
        ->condition('n.nid', $row->getSourceProperty('nid'));
    $query->join('node', 'n', static::JOIN);
    $query->innerJoin('term_data', 'td', '[td].[tid] = [tn].[tid] AND [td].[vid] = :vid', [
        ':vid' => $this->configuration['vid'],
    ]);
    $row->setSourceProperty('tid', $query->execute()
        ->fetchCol());
    return parent::prepareRow($row);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal