You are here

function _cms_content_sync_is_installed in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x cms_content_sync.module \_cms_content_sync_is_installed()
  2. 2.0.x cms_content_sync.module \_cms_content_sync_is_installed()

Check whether the module has been installed properly. If another module creates entities *during* the installation of this module for example, the installation will throw a fatal error and the user can't continue using this module. This can happen when you're using an audit module that logs all site interactions for example.

@returns bool

8 calls to _cms_content_sync_is_installed()
cms_content_sync_entity_delete in ./cms_content_sync.module
Push the entity deletion automatically if configured to do so.
cms_content_sync_entity_insert in ./cms_content_sync.module
Push the entity automatically if configured to do so.
cms_content_sync_entity_operation_alter in ./cms_content_sync.module
Implements hook_entity_operation_alter().
cms_content_sync_entity_translation_delete in ./cms_content_sync.module
Implements hook_entity_translation_delete().
cms_content_sync_entity_update in ./cms_content_sync.module
Push the entity automatically if configured to do so.

... See full list

File

./cms_content_sync.module, line 57
Module file for cms_content_sync.

Code

function _cms_content_sync_is_installed() {
  static $installed = FALSE;
  if ($installed) {
    return TRUE;
  }
  try {
    Drupal::entityTypeManager()
      ->getStorage('cms_content_sync_flow');
    Drupal::entityTypeManager()
      ->getStorage('cms_content_sync_pool');
    Drupal::entityTypeManager()
      ->getStorage('cms_content_sync_entity_status');
    return $installed = TRUE;
  } catch (Exception $e) {
    return FALSE;
  }
}