Skip to content

Commit 1138761

Browse files
committed
ROOMS-82: BOOM said the BAT to BAM
1 parent fc3bcf1 commit 1138761

File tree

5 files changed

+45
-45
lines changed

5 files changed

+45
-45
lines changed

bam_api.info

Lines changed: 0 additions & 12 deletions
This file was deleted.

bat_api.info

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name = Booking and Availability Tools API
2+
description = Provides API access to Rooms Booking and Availability Data for Drupal 7
3+
core = 7.x
4+
php = 5.3.9
5+
6+
package = BAT
7+
8+
dependencies[] = rooms_availability
9+
dependencies[] = rest_server
10+
dependencies[] = services
11+
12+
files[] = includes/bat_api.rooms_unit_field_handler.inc

bam_api.module renamed to bat_api.module

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
/**
4-
* API access to booking data
4+
* API access to booking data for Rooms
55
*/
66

77
/**
88
* Implements hook_ctools_plugin_api().
99
*/
10-
function bam_api_ctools_plugin_api($module = NULL, $api = NULL) {
10+
function bat_api_ctools_plugin_api($module = NULL, $api = NULL) {
1111
if ($module == "services" && $api == "services") {
1212
return array("version" => "3");
1313
}
@@ -16,16 +16,16 @@ function bam_api_ctools_plugin_api($module = NULL, $api = NULL) {
1616
/**
1717
* Implements hook_ctools_plugin_directory().
1818
*/
19-
function bam_api_ctools_plugin_directory($owner, $plugin_type) {
20-
if ($owner == 'bam_api' && $plugin_type == 'rooms_unit_field_handler') {
19+
function bat_api_ctools_plugin_directory($owner, $plugin_type) {
20+
if ($owner == 'bat_api' && $plugin_type == 'rooms_unit_field_handler') {
2121
return 'plugins/rooms_unit_field_handler';
2222
}
2323
}
2424

2525
/**
2626
* Implements hook_ctools_plugin_type().
2727
*/
28-
function bam_api_ctools_plugin_type() {
28+
function bat_api_ctools_plugin_type() {
2929
return array(
3030
'rooms_unit_field_handler' => array(
3131
'use hooks' => TRUE,
@@ -36,7 +36,7 @@ function bam_api_ctools_plugin_type() {
3636
/**
3737
* Implements hook_permission()
3838
*/
39-
function bam_api_permission() {
39+
function bat_api_permission() {
4040
return array(
4141
'access units index service' => array(
4242
'title' => t('Access units index service'),
@@ -76,14 +76,14 @@ function bam_api_permission() {
7676
/**
7777
* Implements hook_services_resources().
7878
*/
79-
function bam_api_services_resources() {
79+
function bat_api_services_resources() {
8080
$resources = array();
8181

8282
$resources['units'] = array(
8383
'operations' => array(
8484
'index' => array(
85-
'callback' => 'bam_api_services_units_index',
86-
'help' => t('Returns an object containing rooms units information.'),
85+
'callback' => 'bat_api_services_units_index',
86+
'help' => t('Returns an object containing bookable unit information.'),
8787
'access arguments' => array('access units index service'),
8888
'args' => array(
8989
array(
@@ -113,9 +113,9 @@ function bam_api_services_resources() {
113113
),
114114
),
115115
'update' => array(
116-
'callback' => 'bam_api_services_edit_unit',
116+
'callback' => 'bat_api_services_edit_unit',
117117
'access arguments' => array('access edit unit service'),
118-
'help' => t('Edit an existing Rooms Unit.'),
118+
'help' => t('Edit an existing Bookable Unit.'),
119119
'args' => array(
120120
array(
121121
'name' => 'unit_id',
@@ -136,9 +136,9 @@ function bam_api_services_resources() {
136136
),
137137
'actions' => array(
138138
'add' => array(
139-
'callback' => 'bam_api_services_add_unit',
139+
'callback' => 'bat_api_services_add_unit',
140140
'access arguments' => array('access add unit service'),
141-
'help' => t('Add a new Rooms Unit.'),
141+
'help' => t('Add a new Bookable Unit.'),
142142
'args' => array(
143143
array(
144144
'name' => 'name',
@@ -183,7 +183,7 @@ function bam_api_services_resources() {
183183
$resources['availability'] = array(
184184
'operations' => array(
185185
'index' => array(
186-
'callback' => 'bam_api_services_availability_index',
186+
'callback' => 'bat_api_services_availability_index',
187187
'help' => t('Returns an object containing availability information.'),
188188
'access arguments' => array('access availability index service'),
189189
'args' => array(
@@ -211,7 +211,7 @@ function bam_api_services_resources() {
211211
),
212212
),
213213
'update' => array(
214-
'callback' => 'bam_api_services_update_availability',
214+
'callback' => 'bat_api_services_update_availability',
215215
'access arguments' => array('access update availability service'),
216216
'help' => t('Update the availability for a given unit.'),
217217
'args' => array(
@@ -237,7 +237,7 @@ function bam_api_services_resources() {
237237
$resources['pricing'] = array(
238238
'operations' => array(
239239
'index' => array(
240-
'callback' => 'bam_api_services_pricing_index',
240+
'callback' => 'bat_api_services_pricing_index',
241241
'help' => t('Returns an object containing pricing information.'),
242242
'access arguments' => array('access pricing index service'),
243243
'args' => array(
@@ -265,7 +265,7 @@ function bam_api_services_resources() {
265265
),
266266
),
267267
'update' => array(
268-
'callback' => 'bam_api_services_update_pricing',
268+
'callback' => 'bat_api_services_update_pricing',
269269
'access arguments' => array('access update pricing service'),
270270
'help' => t('Update the pricing for a given unit.'),
271271
'args' => array(
@@ -291,7 +291,7 @@ function bam_api_services_resources() {
291291
$resources['booking'] = array(
292292
'operations' => array(
293293
'index' => array(
294-
'callback' => 'bam_api_services_booking_index',
294+
'callback' => 'bat_api_services_booking_index',
295295
'help' => t('Returns an object containing booking information.'),
296296
'access arguments' => array('access booking index service'),
297297
'args' => array(
@@ -321,7 +321,7 @@ function bam_api_services_resources() {
321321
),
322322
'actions' => array(
323323
'add' => array(
324-
'callback' => 'bam_api_services_add_booking',
324+
'callback' => 'bat_api_services_add_booking',
325325
'access arguments' => array('access add booking service'),
326326
'help' => t('Add a new Rooms Unit.'),
327327
'args' => array(
@@ -366,12 +366,12 @@ function bam_api_services_resources() {
366366
*
367367
* @param $unit_ids
368368
*/
369-
function bam_api_services_units_index($unit_ids, $offset, $limit) {
369+
function bat_api_services_units_index($unit_ids, $offset, $limit) {
370370
$return = new stdClass();
371371
$return->sessid = session_id();
372372

373373
ctools_include('plugins');
374-
$field_handlers = ctools_get_plugins('bam_api', 'rooms_unit_field_handler');
374+
$field_handlers = ctools_get_plugins('bat_api', 'rooms_unit_field_handler');
375375

376376
$ids = array_filter(explode(',', $unit_ids));
377377

@@ -425,7 +425,7 @@ function bam_api_services_units_index($unit_ids, $offset, $limit) {
425425
* @param $bookable
426426
* @param $status
427427
*/
428-
function bam_api_services_add_unit($name, $type, $default_state, $bookable, $status) {
428+
function bat_api_services_add_unit($name, $type, $default_state, $bookable, $status) {
429429
$return = new stdClass();
430430
$return->sessid = session_id();
431431

@@ -461,7 +461,7 @@ function bam_api_services_add_unit($name, $type, $default_state, $bookable, $sta
461461
* @param $unit_id
462462
* @param $rooms_unit_data
463463
*/
464-
function bam_api_services_edit_unit($unit_id, $rooms_unit_data) {
464+
function bat_api_services_edit_unit($unit_id, $rooms_unit_data) {
465465
$return = new stdClass();
466466
$return->sessid = session_id();
467467

@@ -494,7 +494,7 @@ function bam_api_services_edit_unit($unit_id, $rooms_unit_data) {
494494
* @param $start_date
495495
* @param $duration
496496
*/
497-
function bam_api_services_availability_index($unit_ids, $start_date, $duration) {
497+
function bat_api_services_availability_index($unit_ids, $start_date, $duration) {
498498
$return = new stdClass();
499499
$return->sessid = session_id();
500500

@@ -543,7 +543,7 @@ function bam_api_services_availability_index($unit_ids, $start_date, $duration)
543543
* @param $unit_id
544544
* @param $availability_info
545545
*/
546-
function bam_api_services_update_availability($unit_id, $availability_info) {
546+
function bat_api_services_update_availability($unit_id, $availability_info) {
547547
$return = new stdClass();
548548
$return->sessid = session_id();
549549

@@ -573,7 +573,7 @@ function bam_api_services_update_availability($unit_id, $availability_info) {
573573
* @param $start_date
574574
* @param $duration
575575
*/
576-
function bam_api_services_pricing_index($unit_ids, $start_date, $duration) {
576+
function bat_api_services_pricing_index($unit_ids, $start_date, $duration) {
577577
$return = new stdClass();
578578
$return->sessid = session_id();
579579

@@ -610,7 +610,7 @@ function bam_api_services_pricing_index($unit_ids, $start_date, $duration) {
610610
* @param $unit_id
611611
* @param $pricing_info
612612
*/
613-
function bam_api_services_update_pricing($unit_id, $pricing_info) {
613+
function bat_api_services_update_pricing($unit_id, $pricing_info) {
614614
$return = new stdClass();
615615
$return->sessid = session_id();
616616

@@ -634,7 +634,7 @@ function bam_api_services_update_pricing($unit_id, $pricing_info) {
634634
* @param $start_date
635635
* @param $duration
636636
*/
637-
function bam_api_services_booking_index($unit_ids, $start_date, $duration) {
637+
function bat_api_services_booking_index($unit_ids, $start_date, $duration) {
638638
$return = new stdClass();
639639
$return->sessid = session_id();
640640

@@ -673,7 +673,7 @@ function bam_api_services_booking_index($unit_ids, $start_date, $duration) {
673673
* @param $start_date
674674
* @param $end_date
675675
*/
676-
function bam_api_services_add_booking($type, $start_date, $end_date, $unit_id) {
676+
function bat_api_services_add_booking($type, $start_date, $end_date, $unit_id) {
677677
$return = new stdClass();
678678
$return->sessid = session_id();
679679

bam_api.services.inc renamed to bat_api.services.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
/**
55
* Implements hook_default_services_endpoint().
66
*/
7-
function bam_api_default_services_endpoint() {
7+
function bat_api_default_services_endpoint() {
88
$export = array();
99

1010
$endpoint = new stdClass();
1111
$endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
1212
$endpoint->api_version = 3;
13-
$endpoint->name = 'bam_api';
13+
$endpoint->name = 'bat_api';
1414
$endpoint->server = 'rest_server';
15-
$endpoint->path = 'bam/v1';
15+
$endpoint->path = 'bat/v1';
1616
$endpoint->authentication = array(
1717
'services' => 'services',
1818
);
@@ -100,7 +100,7 @@ function bam_api_default_services_endpoint() {
100100
),
101101
);
102102
$endpoint->debug = 0;
103-
$export['bam_api'] = $endpoint;
103+
$export['bat_api'] = $endpoint;
104104

105105
return $export;
106106
}

0 commit comments

Comments
 (0)