You are here

function bat_event_requirements in Booking and Availability Management Tools for Drupal 8

Same name and namespace in other branches
  1. 7 modules/bat_event/bat_event.install \bat_event_requirements()

Implements hook_requirements().

File

modules/bat_event/bat_event.install, line 15
Sets up the base table for our entity and a table to store information about the entity types.

Code

function bat_event_requirements($phase) {
  if ($phase != 'runtime') {
    return [];
  }
  if (!class_exists('Roomify\\Bat\\Unit\\Unit')) {
    return [
      'roomify' => [
        'title' => t('BAT'),
        'value' => t('Roomify BAT Library Missing'),
        'description' => t('The Roomify BAT Library is missing from your site. Please try re-running the composer update command.'),
        'severity' => REQUIREMENT_ERROR,
      ],
    ];
  }
  else {
    return [
      'roomify' => [
        'title' => t('BAT'),
        'value' => t('The Roomify BAT Library is installed.'),
        'severity' => REQUIREMENT_OK,
      ],
    ];
  }
}