PHPackages                             germania-kg/order-dispatcher - 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. germania-kg/order-dispatcher

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

germania-kg/order-dispatcher
============================

Creating and handling orders

1.1.6(3y ago)043MITPHPPHP ^7.1|^8.0

Since Oct 2Pushed 3y ago2 watchersCompare

[ Source](https://github.com/GermaniaKG/OrderDispatcher)[ Packagist](https://packagist.org/packages/germania-kg/order-dispatcher)[ RSS](/packages/germania-kg-order-dispatcher/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (16)Versions (16)Used By (0)

[![](https://camo.githubusercontent.com/cac3140c0c6e758f67a1ba689683ced67aa2d534e2187d6e03c5c721ffe3b976/68747470733a2f2f7374617469632e6765726d616e69612d6b672e636f6d2f6c6f676f732f67612d6c6f676f2d323031362d7765622e7376677a)](https://camo.githubusercontent.com/cac3140c0c6e758f67a1ba689683ced67aa2d534e2187d6e03c5c721ffe3b976/68747470733a2f2f7374617469632e6765726d616e69612d6b672e636f6d2f6c6f676f732f67612d6c6f676f2d323031362d7765622e7376677a)

---

Germania KG · OrderDispatcher
=============================

[](#germania-kg--orderdispatcher)

**Sourcing that stuff out…**

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

[](#installation)

```
$ composer require germania-kg/order-dispatcher
```

Classes and interfaces
----------------------

[](#classes-and-interfaces)

### Working with orders

[](#working-with-orders)

#### OrderInterface

[](#orderinterface)

```
public function getCustomerData() : array;
public function getItems() : iterable;

```

#### OrderFactoryInterface

[](#orderfactoryinterface)

```
public function createOrder( array $input) : OrderInterface;

public function setItemFactory(ItemFactoryInterface $item_factory);
public function getItemFactory() : ItemFactoryInterface;
```

#### OrderFactoryAbstract

[](#orderfactoryabstract)

This abstract class implements the Item factory interceptors defined in **OrderFactoryInterface** and uses the **ValidatorTrait**.

```
public function setItemFactory(ItemFactoryInterface $item_factory);
public function getItemFactory() : ItemFactoryInterface;
```

#### ArrayOrderFactory

[](#arrayorderfactory)

Creates an **Order** instance from an array, typically from user input.

The *ArrayOrderFactory* extends **OrderFactoryAbstract** and implements the **OrderFactoryInterface**.

The constructor accepts an **ItemFactoryInterface**, the order items array key, and optionally a PSR-3 **LoggerInterface**.

```
