Box.php 960 B

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