3 namespace Drupal\image\Plugin\migrate\source\d6;
5 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
6 use Drupal\migrate\Row;
9 * Drupal 6 imagecache presets source from database.
12 * id = "d6_imagecache_presets",
13 * source_provider = "imagecache"
16 class ImageCachePreset extends DrupalSqlBase {
21 public function query() {
22 $query = $this->select('imagecache_preset', 'icp')
30 public function fields() {
32 'presetid' => $this->t('Preset ID'),
33 'presetname' => $this->t('Preset Name'),
41 public function getIds() {
42 $ids['presetid']['type'] = 'integer';
49 public function prepareRow(Row $row) {
52 $results = $this->select('imagecache_action', 'ica')
54 ->condition('presetid', $row->getSourceProperty('presetid'))
57 foreach ($results as $key => $result) {
58 $actions[$key] = $result;
59 $actions[$key]['data'] = unserialize($result['data']);
62 $row->setSourceProperty('actions', $actions);
63 return parent::prepareRow($row);