You are here

public function Role::prepareRow in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/user/src/Plugin/migrate/source/d6/Role.php \Drupal\user\Plugin\migrate\source\d6\Role::prepareRow()
  2. 8 core/modules/user/src/Plugin/migrate/source/d7/Role.php \Drupal\user\Plugin\migrate\source\d7\Role::prepareRow()
Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Plugin/migrate/source/d6/Role.php \Drupal\user\Plugin\migrate\source\d6\Role::prepareRow()

Add 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

core/modules/user/src/Plugin/migrate/source/d6/Role.php, line 70
Contains \Drupal\user\Plugin\migrate\source\d6\Role.

Class

Role
Drupal 6 role source from database.

Namespace

Drupal\user\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {
  $rid = $row
    ->getSourceProperty('rid');
  $permissions = $this
    ->select('permission', 'p')
    ->fields('p', array(
    'perm',
  ))
    ->condition('rid', $rid)
    ->execute()
    ->fetchField();
  $row
    ->setSourceProperty('permissions', explode(', ', $permissions));
  if (isset($this->filterPermissions[$rid])) {
    $row
      ->setSourceProperty("filter_permissions:{$rid}", $this->filterPermissions[$rid]);
  }
  return parent::prepareRow($row);
}