You are here

function courier_requirements in Courier 8

Same name and namespace in other branches
  1. 2.x courier.install \courier_requirements()

Implements hook_requirements().

File

./courier.install, line 6

Code

function courier_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    $count = \Drupal::entityManager()
      ->getStorage('courier_message_queue_item')
      ->getQuery()
      ->count()
      ->execute();
    $requirements['courier'] = [
      'title' => t('Courier'),
      'severity' => REQUIREMENT_INFO,
      'value' => \Drupal::translation()
        ->formatPlural($count, '@count item in queue.', '@count items in queue.'),
    ];
  }
  return $requirements;
}