You are here

public function SupportTicketReference::prepareRow in Support Ticketing System 8

Adds additional data to the row.

Parameters

\Drupal\migrate\Row $row: The row object.

Return value

bool FALSE if this row needs to be skipped.

Overrides SourcePluginBase::prepareRow

File

modules/support_ticket/src/Plugin/migrate/source/d6/SupportTicketReference.php, line 62
Contains \Drupal\support_ticket\Plugin\migrate\source\d6\SupportTicketReference.

Class

SupportTicketReference
Drupal 6 support ticket source from database.

Namespace

Drupal\support_ticket\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {

  // Select all related tickets (rnid) to the current ticket (nid)
  $query = $this
    ->select('support_reference', 'sr')
    ->fields('sr', array(
    'rnid',
  ))
    ->condition('sr.nid', $row
    ->getSourceProperty('nid'));
  $row
    ->setSourceProperty('rnid', $query
    ->execute()
    ->fetchCol());
  return parent::prepareRow($row);
}