PHPackages                             bootiq/service-layer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bootiq/service-layer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bootiq/service-layer
====================

B!Q Common service layer

01.03.00(3mo ago)124.5k3Apache-2.0PHPPHP ^7.0 || ^8.0CI failing

Since Feb 9Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/bootiq/service-layer)[ Packagist](https://packagist.org/packages/bootiq/service-layer)[ RSS](/packages/bootiq-service-layer/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (12)Versions (14)Used By (0)

BootIq - Service Layer
======================

[](#bootiq---service-layer)

[![BOOT!Q Logo](https://camo.githubusercontent.com/014542b1571c7a819d4a23d33037004383b0892553f339fd86ac39a31ffc6f93/687474703a2f2f7777772e626f6f7469712e696f2f696d616765732f666f6f7465722d6c6f676f2e706e67 "BOOT!Q")](https://camo.githubusercontent.com/014542b1571c7a819d4a23d33037004383b0892553f339fd86ac39a31ffc6f93/687474703a2f2f7777772e626f6f7469712e696f2f696d616765732f666f6f7465722d6c6f676f2e706e67)

[![pipeline status](https://camo.githubusercontent.com/63abe8d51cae901ddfd9e5290bd094f0b6548acb961a7c37079ab532c6489dbb/68747470733a2f2f6769746c61622e6d622d652e736b2f696e7465726e616c2f736572766963652d6c617965722f6261646765732f6d61737465722f706970656c696e652e737667)](https://gitlab.mb-e.sk/internal/service-layer/commits/master) [![coverage report](https://camo.githubusercontent.com/21ec712e2607055b922518d32f0fc0cdd9166b1cd7ef94641d56aedf860ef77e/68747470733a2f2f6769746c61622e6d622d652e736b2f696e7465726e616c2f736572766963652d6c617965722f6261646765732f6d61737465722f636f7665726167652e737667)](https://gitlab.mb-e.sk/internal/service-layer/commits/master)

Service Layer vendor, for SOA communication (REST/SOAP).

Installation
------------

[](#installation)

For installation of Boot!Q Service Layer, use composer:

```
composer require bootiq/service-layer
```

Adapters
--------

[](#adapters)

### BootIq\\ServiceLayer\\Adapter\\GuzzleAdapter

[](#bootiqservicelayeradapterguzzleadapter)

Default adapter is *GuzzleAdapter*, primary for REST communication.

#### Configuration

[](#configuration)

- dependencies
    - client - *GuzzleHttp\\ClientInterface* - client for calling requests.
    - responseFactory - *BootIq\\ServiceLayer\\Response\\ResponseFactoryInterface* - response factory for creating specific response.
    - urn - URN of API (for example: ).
- timeout - request timeout provided by *setTimeout* method (default: 10s).
- cache - if you want cache responses, provide your cache service (PSR-16).
- logger - if you want log what is going on in adapter, provide your logger service (PSR-3).

### Own adapter

[](#own-adapter)

To create your own adapter, you have to implement *BootIq\\ServiceLayer\\Adapter\\AdapterInterface*.

Enum
----

[](#enum)

Library provides enums:

- *BootIq\\ServiceLayer\\Enum\\HttpCode* - List of all HTTP codes according to .
- *BootIq\\ServiceLayer\\Enum\\HttpMethod* - List of all available HTTP methods according to .

Exception
---------

[](#exception)

We provide base exception for working with our service layer (*BootIq\\ServiceLayer\\Exception\\ServiceLayerException*).

Requests
--------

[](#requests)

**Every request which can be called by adapter must implement *BootIq\\ServiceLayer\\Request\\RequestInterface*.**

In *BootIq\\ServiceLayer\\Request* namespace are abstract classes for various http methods, for more simple integration with our service layer.

For example:

```
