function FilterFormat::prepareRow

Same name in this branch
  1. 11.x core/modules/filter/src/Plugin/migrate/source/d6/FilterFormat.php \Drupal\filter\Plugin\migrate\source\d6\FilterFormat::prepareRow()
Same name and namespace in other branches
  1. 10 core/modules/filter/src/Plugin/migrate/source/d6/FilterFormat.php \Drupal\filter\Plugin\migrate\source\d6\FilterFormat::prepareRow()
  2. 10 core/modules/filter/src/Plugin/migrate/source/d7/FilterFormat.php \Drupal\filter\Plugin\migrate\source\d7\FilterFormat::prepareRow()
  3. 9 core/modules/filter/src/Plugin/migrate/source/d6/FilterFormat.php \Drupal\filter\Plugin\migrate\source\d6\FilterFormat::prepareRow()
  4. 9 core/modules/filter/src/Plugin/migrate/source/d7/FilterFormat.php \Drupal\filter\Plugin\migrate\source\d7\FilterFormat::prepareRow()
  5. 8.9.x core/modules/filter/src/Plugin/migrate/source/d6/FilterFormat.php \Drupal\filter\Plugin\migrate\source\d6\FilterFormat::prepareRow()
  6. 8.9.x core/modules/filter/src/Plugin/migrate/source/d7/FilterFormat.php \Drupal\filter\Plugin\migrate\source\d7\FilterFormat::prepareRow()

Overrides SourcePluginBase::prepareRow

File

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

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.