class ResponsiveImageStyles
Same name and namespace in other branches
- 10 core/modules/responsive_image/src/Plugin/migrate/source/d7/ResponsiveImageStyles.php \Drupal\responsive_image\Plugin\migrate\source\d7\ResponsiveImageStyles
- 11.x core/modules/responsive_image/src/Plugin/migrate/source/d7/ResponsiveImageStyles.php \Drupal\responsive_image\Plugin\migrate\source\d7\ResponsiveImageStyles
Gets Drupal responsive image styles source from database.
Breakpoints are YAML files in Drupal 8. If you have a custom theme and want to migrate its responsive image styles to Drupal 8, create the respective your_theme.breakpoints.yml file at the root of the theme.
Plugin annotation
@MigrateSource(
id = "d7_responsive_image_styles",
source_module = "picture"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\migrate\Plugin\migrate\source\SourcePluginBase implements \Drupal\migrate\Plugin\MigrateSourceInterface, \Drupal\migrate\Event\RollbackAwareInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\migrate\Plugin\migrate\source\SqlBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\migrate\Plugin\RequirementsInterface extends \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase implements \Drupal\Component\Plugin\DependentPluginInterface uses \Drupal\Core\Entity\DependencyTrait extends \Drupal\migrate\Plugin\migrate\source\SqlBase
- class \Drupal\responsive_image\Plugin\migrate\source\d7\ResponsiveImageStyles extends \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase implements \Drupal\Component\Plugin\DependentPluginInterface uses \Drupal\Core\Entity\DependencyTrait extends \Drupal\migrate\Plugin\migrate\source\SqlBase
- class \Drupal\migrate\Plugin\migrate\source\SqlBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\migrate\Plugin\RequirementsInterface extends \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
- class \Drupal\migrate\Plugin\migrate\source\SourcePluginBase implements \Drupal\migrate\Plugin\MigrateSourceInterface, \Drupal\migrate\Event\RollbackAwareInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of ResponsiveImageStyles
See also
https://www.drupal.org/docs/8/theming-drupal-8/working-with-breakpoints…
File
-
core/
modules/ responsive_image/ src/ Plugin/ migrate/ source/ d7/ ResponsiveImageStyles.php, line 23
Namespace
Drupal\responsive_image\Plugin\migrate\source\d7View source
class ResponsiveImageStyles extends DrupalSqlBase {
/**
* {@inheritdoc}
*/
public function query() {
return $this->select('picture_mapping', 'p')
->fields('p');
}
/**
* {@inheritdoc}
*/
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;
}
/**
* {@inheritdoc}
*/
public function getIds() {
$ids['machine_name']['type'] = 'string';
return $ids;
}
/**
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
$row->setSourceProperty('mapping', unserialize($row->getSourceProperty('mapping')));
return parent::prepareRow($row);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.