You are here

function layout_builder_st_requirements in Layout Builder Symmetric Translations 8

Implements hook_requirements().

File

./layout_builder_st.install, line 72

Code

function layout_builder_st_requirements($phase) {
  $requirements = [];
  if ($phase === 'install' && \Drupal::moduleHandler()
    ->moduleExists('layout_builder_at')) {
    $requirements['layout_builder_at_incompatibility'] = [
      'severity' => REQUIREMENT_ERROR,
      'description' => t('Layout Builder Symmetric Translations can not be installed when Layout Builder Asymmetric Translations is also installed.'),
    ];
  }
  if ($phase === 'runtime' && \Drupal::moduleHandler()
    ->moduleExists('layout_builder_at')) {
    $requirements['layout_builder_at_incompatibility'] = [
      'severity' => REQUIREMENT_ERROR,
      'description' => t('Layout Builder Symmetric Translations is not compatible with Layout Builder Asymmetric Translations. One of these should be uninstalled'),
    ];
  }
  return $requirements;
}