function ImageStyles::prepareRow

Same name in other branches
  1. 9 core/modules/image/src/Plugin/migrate/source/d7/ImageStyles.php \Drupal\image\Plugin\migrate\source\d7\ImageStyles::prepareRow()
  2. 8.9.x core/modules/image/src/Plugin/migrate/source/d7/ImageStyles.php \Drupal\image\Plugin\migrate\source\d7\ImageStyles::prepareRow()
  3. 10 core/modules/image/src/Plugin/migrate/source/d7/ImageStyles.php \Drupal\image\Plugin\migrate\source\d7\ImageStyles::prepareRow()

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

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