<?php

/**
 * @file
 * Install, update and uninstall functions for the NodeHive Entity Access module.
 */

/**
 * Implements hook_install().
 */
function nodehive_entity_access_install() {
  // Clear all caches to ensure our access control takes effect immediately.
  drupal_flush_all_caches();
  \Drupal::logger('nodehive_entity_access')->notice('NodeHive Entity Access module installed, caches cleared.');
}

/**
 * Implements hook_uninstall().
 */
function nodehive_entity_access_uninstall() {
  // Clear caches on uninstall to restore default access behavior.
  drupal_flush_all_caches();
}

/**
 * Clear caches to ensure entity access controls are applied.
 */
function nodehive_entity_access_update_8001() {
  drupal_flush_all_caches();
  return t('Caches cleared to ensure entity access controls are applied correctly.');
}
