0a1da1920e4f0a9d2c6aac0a076acb2ac7bb7d33
[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  *   source_module = "block"
13  * )
14  */
15 class Box extends DrupalSqlBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   public function query() {
21     $query = $this->select('boxes', 'b')
22       ->fields('b', ['bid', 'body', 'info', 'format']);
23     $query->orderBy('b.bid');
24
25     return $query;
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   public function fields() {
32     return [
33       'bid' => $this->t('The numeric identifier of the block/box'),
34       'body' => $this->t('The block/box content'),
35       'info' => $this->t('Admin title of the block/box.'),
36       'format' => $this->t('Input format of the custom block/box content.'),
37     ];
38   }
39
40   /**
41    * {@inheritdoc}
42    */
43   public function getIds() {
44     $ids['bid']['type'] = 'integer';
45     return $ids;
46   }
47
48 }