You are here

public function ImageStyles::prepareRow in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/image/src/Plugin/migrate/source/d7/ImageStyles.php \Drupal\image\Plugin\migrate\source\d7\ImageStyles::prepareRow()
  2. 9 core/modules/image/src/Plugin/migrate/source/d7/ImageStyles.php \Drupal\image\Plugin\migrate\source\d7\ImageStyles::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/image/src/Plugin/migrate/source/d7/ImageStyles.php, line 56

Class

ImageStyles
Drupal 7 image styles source from database.

Namespace

Drupal\image\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {
  $effects = [];
  $results = $this
    ->select('image_effects', 'ie')
    ->fields('ie')
    ->condition('isid', $row
    ->getSourceProperty('isid'))
    ->execute();
  foreach ($results as $key => $result) {
    $result['data'] = unserialize($result['data']);
    $effects[$key] = $result;
  }
  $row
    ->setSourceProperty('effects', $effects);
  return parent::prepareRow($row);
}