Flow2Lab/EventSourcing

View on GitHub
Classes/Flow2Lab/EventSourcing/AggregateRootInterface.php

Summary

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

interface AggregateRootInterface
{

    /**
     * @param array $stream
     * @return AggregateRootInterface
     */
    static public function loadFromEventStream(array $stream = []);

    /**
     * @return string Global identifier of the aggregate
     */
    public function getIdentifier();

    /**
     * @return array<DomainEvent>
     */
    public function getUncommittedChanges();

    /**
     * Empties the uncommitted changes
     *
     * @return void
     */
    public function markChangesAsCommitted();

}