You are here

courier.install in Courier 8

Same filename and directory in other branches
  1. 2.x courier.install

File

courier.install
View source
<?php

/**
 * Implements hook_requirements().
 */
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;
}

/**
 * Install global template collection entity.
 */
function courier_update_8001() {
  $entity_manager = \Drupal::entityTypeManager();
  $update_manager = \Drupal::entityDefinitionUpdateManager();
  $entity_type = $entity_manager
    ->getDefinition('template_collection_global');
  $update_manager
    ->installEntityType($entity_type);
}

Functions

Namesort descending Description
courier_requirements Implements hook_requirements().
courier_update_8001 Install global template collection entity.