You are here

public function ImageStyles::prepareRow in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/image/src/Plugin/migrate/source/d7/ImageStyles.php \Drupal\image\Plugin\migrate\source\d7\ImageStyles::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/image/src/Plugin/migrate/source/d7/ImageStyles.php, line 54
Contains \Drupal\image\Plugin\migrate\source\d7\ImageStyles.

Class

ImageStyles
Drupal image styles source from database.

Namespace

Drupal\image\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {
  $effects = array();
  $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);
}