BlockCustom.php 897 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Drupal\block_content\Plugin\migrate\source\d7;
  3. use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
  4. /**
  5. * Drupal 7 custom block source from database.
  6. *
  7. * @MigrateSource(
  8. * id = "d7_block_custom",
  9. * source_module = "block"
  10. * )
  11. */
  12. class BlockCustom extends DrupalSqlBase {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function query() {
  17. return $this->select('block_custom', 'b')->fields('b');
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function fields() {
  23. return [
  24. 'bid' => $this->t('The numeric identifier of the block/box'),
  25. 'body' => $this->t('The block/box content'),
  26. 'info' => $this->t('Admin title of the block/box.'),
  27. 'format' => $this->t('Input format of the custom block/box content.'),
  28. ];
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function getIds() {
  34. $ids['bid']['type'] = 'integer';
  35. return $ids;
  36. }
  37. }