ResponsiveImageStyles.php in Drupal 10
File
core/modules/responsive_image/src/Plugin/migrate/source/d7/ResponsiveImageStyles.php
View source
<?php
namespace Drupal\responsive_image\Plugin\migrate\source\d7;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
class ResponsiveImageStyles extends DrupalSqlBase {
public function query() {
return $this
->select('picture_mapping', 'p')
->fields('p');
}
public function fields() {
$fields = [
'label' => $this
->t('The human-readable name of the mapping'),
'machine_name' => $this
->t('The machine name of the mapping'),
'breakpoint_group' => $this
->t('The group this mapping belongs to'),
'mapping' => $this
->t('The mappings linked to the breakpoints group'),
];
return $fields;
}
public function getIds() {
$ids['machine_name']['type'] = 'string';
return $ids;
}
public function prepareRow(Row $row) {
$row
->setSourceProperty('mapping', unserialize($row
->getSourceProperty('mapping')));
return parent::prepareRow($row);
}
}