interface BlockContentInterface

Same name and namespace in other branches
  1. 11.x core/modules/block_content/src/BlockContentInterface.php \Drupal\block_content\BlockContentInterface

Provides an interface defining a custom block entity.

Hierarchy

Expanded class hierarchy of BlockContentInterface

All classes that implement BlockContentInterface

5 files declare their use of BlockContentInterface
BlockContent.php in core/modules/block_content/src/Entity/BlockContent.php
BlockContentEntityChangedConstraintValidator.php in core/modules/block_content/src/Plugin/Validation/Constraint/BlockContentEntityChangedConstraintValidator.php
BlockContentGetDependencyEvent.php in core/modules/block_content/src/Event/BlockContentGetDependencyEvent.php
MigrateCustomBlockTest.php in core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php
SetInlineBlockDependency.php in core/modules/layout_builder/src/EventSubscriber/SetInlineBlockDependency.php

File

core/modules/block_content/src/BlockContentInterface.php, line 14

Namespace

Drupal\block_content
View source
interface BlockContentInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface, EntityPublishedInterface, RefinableDependentAccessInterface {
  
  /**
   * Sets the block description.
   *
   * @param string $info
   *   The block description.
   *
   * @return $this
   *   The class instance that this method is called on.
   */
  public function setInfo($info);
  
  /**
   * Determines if the block is reusable or not.
   *
   * @return bool
   *   Returns TRUE if reusable and FALSE otherwise.
   */
  public function isReusable();
  
  /**
   * Sets the block to be reusable.
   *
   * @return $this
   */
  public function setReusable();
  
  /**
   * Sets the block to be non-reusable.
   *
   * @return $this
   */
  public function setNonReusable();
  
  /**
   * Sets the theme value.
   *
   * When creating a new block content 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 block content add form is shown.
   *
   * @param string $theme
   *   The theme name.
   *
   * @return $this
   *   The class instance that this method is called on.
   */
  public function setTheme($theme);
  
  /**
   * Gets the theme value.
   *
   * When creating a new block content 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 block content 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();

}

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