You are here

function data_policy_update_8009 in Data Policy 8

Update "user_consent" required field for all old entities.

File

./data_policy.install, line 165
Install, update and uninstall functions for the data_policy module.

Code

function data_policy_update_8009() {
  $database = \Drupal::database();
  $config = \Drupal::configFactory()
    ->get('data_policy.data_policy');
  $enforce_consent = $config
    ->get('enforce_consent');
  $database
    ->update('user_consent')
    ->fields([
    'required' => $enforce_consent,
  ])
    ->execute();
}