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