class BlockCustom

Same name and namespace in other branches
  1. 11.x core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php \Drupal\block_content\Plugin\migrate\source\d7\BlockCustom
  2. 10 core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php \Drupal\block_content\Plugin\migrate\source\d7\BlockCustom
  3. 8.9.x core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php \Drupal\block_content\Plugin\migrate\source\d7\BlockCustom

Drupal 7 custom block source from database.

For available configuration keys, refer to the parent classes.

Plugin annotation


@MigrateSource(
  id = "d7_block_custom",
  source_module = "block"
)

Hierarchy

Expanded class hierarchy of BlockCustom

See also

\Drupal\migrate\Plugin\migrate\source\SqlBase

\Drupal\migrate\Plugin\migrate\source\SourcePluginBase

File

core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustom.php, line 20

Namespace

Drupal\block_content\Plugin\migrate\source\d7
View source
class BlockCustom extends DrupalSqlBase {
  
  /**
   * {@inheritdoc}
   */
  public function query() {
    return $this->select('block_custom', 'b')
      ->fields('b');
  }
  
  /**
   * {@inheritdoc}
   */
  public function fields() {
    return [
      'bid' => $this->t('The numeric identifier of the block/box'),
      'body' => $this->t('The block/box content'),
      'info' => $this->t('Admin title of the block/box.'),
      'format' => $this->t('Input format of the custom block/box content.'),
    ];
  }
  
  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['bid']['type'] = 'integer';
    return $ids;
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.