-
Notifications
You must be signed in to change notification settings - Fork 0
Navigating a stream
Davide Bellettini edited this page Jul 27, 2014
·
8 revisions
use EventStore\EventStore;
use EventStore\StreamFeed\LinkRelation;
$es = new EventStore('http://127.0.0.1:2113/');
$feed = $es->openStreamFeed('StreamName');
$feed = $es->navigateStreamFeed($feed, LinkRelation::LAST());
$rel = LinkRelation::PREVIOUS();
do {
foreach ($feed->getEntries() as $entry) {
$event = $es->readEvent($entry->getEventUrl());
$type = $entry->getType();
}
} while (null !== ($feed = $es->navigateStreamFeed($feed, $rel)));This project is not endorsed by EventStore LLC
but they sent us Ouro plushes 😄 and we thank them