function ConfigTestHooksHooks::updateIsSyncingStore

Helper function for testing hooks during configuration sync.

Parameters

string $hook: The fired hook.

\Drupal\config_test\Entity\ConfigTest $config_test: The ConfigTest entity.

6 calls to ConfigTestHooksHooks::updateIsSyncingStore()
ConfigTestHooksHooks::configTestCreate in core/modules/config/tests/config_test/src/Hook/ConfigTestHooksHooks.php
Implements hook_ENTITY_TYPE_create() for 'config_test'.
ConfigTestHooksHooks::configTestDelete in core/modules/config/tests/config_test/src/Hook/ConfigTestHooksHooks.php
Implements hook_config_test_delete().
ConfigTestHooksHooks::configTestInsert in core/modules/config/tests/config_test/src/Hook/ConfigTestHooksHooks.php
Implements hook_config_test_insert().
ConfigTestHooksHooks::configTestPredelete in core/modules/config/tests/config_test/src/Hook/ConfigTestHooksHooks.php
Implements hook_config_test_predelete().
ConfigTestHooksHooks::configTestPresave in core/modules/config/tests/config_test/src/Hook/ConfigTestHooksHooks.php
Implements hook_config_test_presave().

... See full list

File

core/modules/config/tests/config_test/src/Hook/ConfigTestHooksHooks.php, line 87

Class

ConfigTestHooksHooks
Hook implementations for config_test.

Namespace

Drupal\config_test\Hook

Code

protected function updateIsSyncingStore($hook, ConfigTest $config_test) {
    $current_value = \Drupal::state()->get('config_test.store_isSyncing', FALSE);
    if ($current_value !== FALSE) {
        $current_value['global_state::' . $hook] = \Drupal::isConfigSyncing();
        $current_value['entity_state::' . $hook] = $config_test->isSyncing();
        \Drupal::state()->set('config_test.store_isSyncing', $current_value);
    }
}

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