You are here

public function ForumAccess::prepareRow in Forum Access 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

forum_access_migrate/src/Plugin/migrate/source/ForumAccess.php, line 57

Class

ForumAccess
Provides table source plugin.

Namespace

Drupal\forum_access_migrate\Plugin\migrate\source

Code

public function prepareRow(Row $row) {
  parent::prepareRow($row);

  // Get moderators.
  $tid = $row
    ->getSourceProperty('tid');
  $query = $this
    ->select('acl_user', 'au');
  $query
    ->innerJoin('acl', 'a', 'au.acl_id = a.acl_id');
  $moderators = $query
    ->fields('au', [
    'uid',
  ])
    ->condition('a.module', 'forum_access')
    ->condition('a.number', $tid)
    ->execute()
    ->fetchCol();
  $row
    ->setSourceProperty('moderators', $moderators);
}