eventbrite_one_way_sync-1.0.0/eventbrite_one_way_sync.install

eventbrite_one_way_sync.install
<?php

/**
 * @file
 * Install hooks.
 */

/**
 * Implements hook_schema().
 *
 * Defines the database tables used by this module.
 *
 * @see hook_schema()
 */
function eventbrite_one_way_sync_schema() {
  $schema['eventbrite_one_way_sync'] = [
    'description' => 'Queue of events and series to process.',
    'fields' => [
      'eid' => [
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique event ID.',
      ],
      'remote_id' => [
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Either a remote series or remote event.',
      ],
      'occurrence_id' => [
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'A remote event.',
      ],
      'struct' => [
        'type' => 'text',
        'size' => 'medium',
        'not null' => FALSE,
        'description' => 'The response.',
      ],
      'status' => [
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => 'new',
        'description' => 'The status of the event.',
      ],
    ],
    'primary key' => ['eid'],
    'indexes' => [
      'remote_id' => ['remote_id'],
      'occurrence_id' => ['occurrence_id'],
      'status' => ['status'],
    ],
  ];

  return $schema;
}

/**
 * Implements hook_requirements().
 */
function eventbrite_one_way_sync_requirements(string $phase) : array {
  // Make sure the phase is runtime, otherwise (during installation for
  // example) the eventbrite_one_way_sync.requirements service will not be
  // available.
  if ($phase != 'runtime') {
    // If ther are any non-runtime requirements, we do not have access
    // to the eventbrite_one_way_sync.requirements, so we would define them
    // here. (There are none at the time of this writing.)
    return [];
  }
  return \Drupal::service('eventbrite_one_way_sync.requirements')
    ->hookRequirements($phase);
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc