You are here

public function FilterFormat::prepareRow in Drupal 8

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

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

core/modules/filter/src/Plugin/migrate/source/d7/FilterFormat.php, line 42

Class

FilterFormat
Drupal 7 filter source from database.

Namespace

Drupal\filter\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {

  // Find filters for this format.
  $filters = $this
    ->select('filter', 'f')
    ->fields('f')
    ->condition('format', $row
    ->getSourceProperty('format'))
    ->condition('status', 1)
    ->execute()
    ->fetchAllAssoc('name');
  foreach ($filters as $id => $filter) {
    $filters[$id]['settings'] = unserialize($filter['settings']);
  }
  $row
    ->setSourceProperty('filters', $filters);
  return parent::prepareRow($row);
}