function BlockContentTestHooks::blockContentUpdate

Implements hook_block_content_update().

File

core/modules/block_content/tests/modules/block_content_test/src/Hook/BlockContentTestHooks.php, line 45

Class

BlockContentTestHooks
Hook implementations for block_content_test.

Namespace

Drupal\block_content_test\Hook

Code

public function blockContentUpdate(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');
        }
    }
}

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