You are here

function block_content_test_block_content_update in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/block_content/tests/modules/block_content_test/block_content_test.module \block_content_test_block_content_update()

Implements hook_block_content_update().

File

core/modules/block_content/tests/modules/block_content_test/block_content_test.module, line 43
A dummy module for testing custom block related hooks.

Code

function block_content_test_block_content_update(BlockContent $block_content) {

  // Determine changes on update.
  if (!empty($block_content->original) && $block_content->original
    ->label() == 'test_changes') {
    if ($block_content->original
      ->label() != $block_content
      ->label()) {
      $block_content
        ->setInfo($block_content
        ->label() . '_update');
    }
  }
}