You are here

public function Blocks::updateBlock in Context 8

Same name and namespace in other branches
  1. 8.4 src/Plugin/ContextReaction/Blocks.php \Drupal\context\Plugin\ContextReaction\Blocks::updateBlock()
  2. 8.0 src/Plugin/ContextReaction/Blocks.php \Drupal\context\Plugin\ContextReaction\Blocks::updateBlock()

Update an existing blocks configuration.

Parameters

string $blockId: The ID of the block to update.

$configuration: The updated configuration for the block.

Return value

$this

1 call to Blocks::updateBlock()
Blocks::submitConfigurationForm in src/Plugin/ContextReaction/Blocks.php
Form submission handler.

File

src/Plugin/ContextReaction/Blocks.php, line 386

Class

Blocks
Provides a content reaction that will let you place blocks in the current themes regions.

Namespace

Drupal\context\Plugin\ContextReaction

Code

public function updateBlock($blockId, array $configuration) {
  $existingConfiguration = $this
    ->getBlock($blockId)
    ->getConfiguration();
  $this
    ->getBlocks()
    ->setInstanceConfiguration($blockId, $configuration + $existingConfiguration);
  return $this;
}