"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php" (26 Nov 2020, 897 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "BlockCustom.php" see the Fossies "Dox" file reference documentation.

    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 }