function ImageCachePreset::prepareRow

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

Overrides SourcePluginBase::prepareRow

File

core/modules/image/src/Plugin/migrate/source/d6/ImageCachePreset.php, line 54

Class

ImageCachePreset
Drupal 6 imagecache presets source from database.

Namespace

Drupal\image\Plugin\migrate\source\d6

Code

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

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