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