Flow2Lab/EventSourcing

View on GitHub
Classes/Flow2Lab/EventSourcing/Store/Backend/StoreBackendInterface.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
namespace Flow2Lab\EventSourcing\Store\Backend;

use Flow2Lab\EventSourcing\Event\DomainEvent;
use Flow2Lab\EventSourcing\Store\Backend\Exception\EventStreamNotFoundException;
use Flow2Lab\EventSourcing\Store\Backend\Exception\OptimisticLockException;

interface StoreBackendInterface
{

    /**
     * @param string $identifier
     * @param DomainEvent[] $events
     * @return void
     * @throws OptimisticLockException
     */
    public function append($identifier, array $events);

    /**
     * @param string $identifier
     * @return DomainEvent[]
     * @throws EventStreamNotFoundException
     */
    public function load($identifier);

}