-
Notifications
You must be signed in to change notification settings - Fork 0
/
eventbrite_one_way_sync.install
78 lines (74 loc) · 1.99 KB
/
eventbrite_one_way_sync.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?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);
}