You are here

public function BlockContent::setTheme in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/block_content/src/Entity/BlockContent.php \Drupal\block_content\Entity\BlockContent::setTheme()
  2. 9 core/modules/block_content/src/Entity/BlockContent.php \Drupal\block_content\Entity\BlockContent::setTheme()

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.

Parameters

string $theme: The theme name.

Return value

$this The class instance that this method is called on.

Overrides BlockContentInterface::setTheme

File

core/modules/block_content/src/Entity/BlockContent.php, line 107

Class

BlockContent
Defines the custom block entity class.

Namespace

Drupal\block_content\Entity

Code

public function setTheme($theme) {
  $this->theme = $theme;
  return $this;
}