Commit 8b08e319 authored by nicola85's avatar nicola85

Updates for Services 4.0-beta1

parent aff25978
<?php
/**
* Implements hook_install().
*/
function hook_install() {
$rest = \Drupal::configFactory()->getEditable('rest.settings');
$resources = $rest->get('resources');
$resources['entity:bat_event'] = array(
'PATCH' => array(
'supported_formats' => array(
'hal_json',
'json',
),
'supported_auth' => array(
'cookie',
),
),
);
$rest->set('resources', $resources)->save(TRUE);
}
langcode: en
status: true
dependencies: { }
_core:
default_config_hash: QkKAtBvm2PHW7oGbO8C-kN_wSU3KGNPQvRRtWLmVhiI
id: bat_api
label: 'Bat api'
service_providers:
'calendar_events_index:calendar-events': 'calendar_events_index:calendar-events'
'events_index:events': 'events_index:events'
'unit_index:calendar-units': 'unit_index:calendar-units'
'entity_delete:bat_type_group': 'entity_delete:bat_type_group'
'entity_delete:bat_type_group_bundle': 'entity_delete:bat_type_group_bundle'
'entity_delete:bat_event': 'entity_delete:bat_event'
'entity_delete:bat_event_type': 'entity_delete:bat_event_type'
'entity_delete:state': 'entity_delete:state'
'entity_delete:bat_type_bundle': 'entity_delete:bat_type_bundle'
'entity_delete:bat_unit': 'entity_delete:bat_unit'
'entity_delete:bat_unit_bundle': 'entity_delete:bat_unit_bundle'
'entity_delete:bat_unit_type': 'entity_delete:bat_unit_type'
'entity_get:bat_type_group': 'entity_get:bat_type_group'
'entity_get:bat_type_group_bundle': 'entity_get:bat_type_group_bundle'
'entity_get:bat_event': 'entity_get:bat_event'
'entity_get:bat_event_type': 'entity_get:bat_event_type'
'entity_get:state': 'entity_get:state'
'entity_get:bat_type_bundle': 'entity_get:bat_type_bundle'
'entity_get:bat_unit': 'entity_get:bat_unit'
'entity_get:bat_unit_bundle': 'entity_get:bat_unit_bundle'
'entity_get:bat_unit_type': 'entity_get:bat_unit_type'
'entity_index:bat_type_group': 'entity_index:bat_type_group'
'entity_index:bat_type_group_bundle': 'entity_index:bat_type_group_bundle'
'entity_index:bat_event': 'entity_index:bat_event'
'entity_index:bat_event_type': 'entity_index:bat_event_type'
'entity_index:state': 'entity_index:state'
'entity_index:bat_type_bundle': 'entity_index:bat_type_bundle'
'entity_index:bat_unit': 'entity_index:bat_unit'
'entity_index:bat_unit_bundle': 'entity_index:bat_unit_bundle'
'entity_index:bat_unit_type': 'entity_index:bat_unit_type'
'entity_post:bat_type_group': 'entity_post:bat_type_group'
'entity_post:bat_type_group_bundle': 'entity_post:bat_type_group_bundle'
'entity_post:bat_event': 'entity_post:bat_event'
'entity_post:bat_event_type': 'entity_post:bat_event_type'
'entity_post:state': 'entity_post:state'
'entity_post:bat_type_bundle': 'entity_post:bat_type_bundle'
'entity_post:bat_unit': 'entity_post:bat_unit'
'entity_post:bat_unit_bundle': 'entity_post:bat_unit_bundle'
'entity_post:bat_unit_type': 'entity_post:bat_unit_type'
'entity_put:bat_type_group': 'entity_put:bat_type_group'
'entity_put:bat_type_group_bundle': 'entity_put:bat_type_group_bundle'
'entity_put:bat_event': 'entity_put:bat_event'
'entity_put:bat_event_type': 'entity_put:bat_event_type'
'entity_put:state': 'entity_put:state'
'entity_put:bat_type_bundle': 'entity_put:bat_type_bundle'
'entity_put:bat_unit': 'entity_put:bat_unit'
'entity_put:bat_unit_bundle': 'entity_put:bat_unit_bundle'
'entity_put:bat_unit_type': 'entity_put:bat_unit_type'
'entity_view:bat_type_group': 'entity_view:bat_type_group'
'entity_view:bat_event': 'entity_view:bat_event'
'entity_view:bat_unit': 'entity_view:bat_unit'
'entity_view:bat_unit_type': 'entity_view:bat_unit_type'
endpoint: bat_api
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.calendar_events_index.calendar-events
service_plugin_id: 'calendar_events_index:calendar-events'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_delete.bat_event
service_plugin_id: 'entity_delete:bat_event'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_delete.bat_type_group
service_plugin_id: 'entity_delete:bat_type_group'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_delete.bat_unit
service_plugin_id: 'entity_delete:bat_unit'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_delete.bat_unit_type
service_plugin_id: 'entity_delete:bat_unit_type'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_delete.state
service_plugin_id: 'entity_delete:state'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_get.bat_event
service_plugin_id: 'entity_get:bat_event'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_get.bat_type_group
service_plugin_id: 'entity_get:bat_type_group'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_get.bat_unit
service_plugin_id: 'entity_get:bat_unit'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_get.bat_unit_type
service_plugin_id: 'entity_get:bat_unit_type'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_get.state
service_plugin_id: 'entity_get:state'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_index.bat_event
service_plugin_id: 'entity_index:bat_event'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_index.bat_type_group
service_plugin_id: 'entity_index:bat_type_group'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_index.bat_unit
service_plugin_id: 'entity_index:bat_unit'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_index.bat_unit_type
service_plugin_id: 'entity_index:bat_unit_type'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_index.state
service_plugin_id: 'entity_index:state'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_post.bat_event
service_plugin_id: 'entity_post:bat_event'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_post.bat_type_group
service_plugin_id: 'entity_post:bat_type_group'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_post.bat_unit
service_plugin_id: 'entity_post:bat_unit'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_post.bat_unit_type
service_plugin_id: 'entity_post:bat_unit_type'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_post.state
service_plugin_id: 'entity_post:state'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_put.bat_event
service_plugin_id: 'entity_put:bat_event'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_put.bat_type_group
service_plugin_id: 'entity_put:bat_type_group'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_put.bat_unit
service_plugin_id: 'entity_put:bat_unit'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_put.bat_unit_type
service_plugin_id: 'entity_put:bat_unit_type'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.entity_put.state
service_plugin_id: 'entity_put:state'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.matching_unit_index.calendar-matching-units
service_plugin_id: 'matching_unit_index:calendar-matching-units'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
langcode: en
status: true
dependencies:
module:
- user
id: bat_api.unit_index.calendar-units
service_plugin_id: 'unit_index:calendar-units'
service_endpoint_id: bat_api
formats:
json: json
hal_json: '0'
xml: '0'
authentication:
cookie: cookie
......@@ -174,7 +174,7 @@ class CalendarEventsIndex extends ServiceDefinitionBase implements ContainerFact
foreach ($event_ids as $unit_id => $unit_events) {
foreach ($unit_events as $key => $event) {
$events_json[] = array(
'id' => (string)$key . $unit_id,
'id' => (string) $key . $unit_id,
'bat_id' => $event->getValue(),
'resourceId' => 'S' . $unit_id,
) + $event->toJson($event_formatter);
......
......@@ -144,7 +144,7 @@ class EventsIndex extends ServiceDefinitionBase implements ContainerFactoryPlugi
foreach ($event_ids as $unit_id => $unit_events) {
foreach ($unit_events as $key => $event) {
$events_json[] = array(
'id' => (string)$key . $unit_id,
'id' => (string) $key . $unit_id,
'bat_id' => $event->getValue(),
'resourceId' => 'S' . $unit_id,
) + $event->toJson($event_formatter);
......
......@@ -14,8 +14,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\bat_unit\Entity\TypeBundle;
use Roomify\Bat\Calendar\Calendar;
use Roomify\Bat\Store\DrupalDBStore;
......
......@@ -15,7 +15,6 @@ use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\bat_unit\Entity\TypeBundle;
/**
* @ServiceDefinition(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment