CustomBlockInterface.php

Contains \Drupal\custom_block\Plugin\Core\Entity\CustomBlockInterface.

Namespace

Drupal\custom_block

File

drupal/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockInterface.php
View source
<?php

/**
 * @file
 * Contains \Drupal\custom_block\Plugin\Core\Entity\CustomBlockInterface.
 */
namespace Drupal\custom_block;

use Drupal\Core\Entity\ContentEntityInterface;

/**
 * Provides an interface defining a custom block entity.
 */
interface CustomBlockInterface extends ContentEntityInterface {

  /**
   * Sets the theme value.
   *
   * When creating a new custom block from the block library, the user is
   * redirected to the configure form for that block in the given theme. The
   * theme is stored against the block when the custom block add form is shown.
   *
   * @param string $theme
   *   The theme name.
   */
  public function setTheme($theme);

  /**
   * Gets the theme value.
   *
   * When creating a new custom block from the block library, the user is
   * redirected to the configure form for that block in the given theme. The
   * theme is stored against the block when the custom block add form is shown.
   *
   * @return string
   *   The theme name.
   */
  public function getTheme();

  /**
   * Gets the configured instances of this custom block.
   *
   * @return array
   *   Array of Drupal\block\Core\Plugin\Entity\Block entities.
   */
  public function getInstances();

}

Interfaces

Namesort descending Description
CustomBlockInterface Provides an interface defining a custom block entity.