streamEvents() public method

public streamEvents ( ) : Iterato\Iterator
return Iterato\Iterator
 /**
  * @param Stream $stream
  * @throws \Prooph\EventStore\Exception\RuntimeException If creation of stream fails
  * @return void
  */
 public function create(Stream $stream)
 {
     if (count($stream->streamEvents()) === 0) {
         throw new RuntimeException(sprintf("Cannot create empty stream %s. %s requires at least one event to extract metadata information", $stream->streamName()->toString(), __CLASS__));
     }
     $firstEvent = $stream->streamEvents()[0];
     $this->createSchemaFor($stream->streamName(), $firstEvent->metadata());
     $this->appendTo($stream->streamName(), $stream->streamEvents());
 }
 /**
  * @param Stream $stream
  */
 public function create(Stream $stream)
 {
     $this->appendTo($stream->streamName(), $stream->streamEvents());
 }
Ejemplo n.º 3
0
 /**
  * @param Stream $stream
  * @return void
  */
 public function create(Stream $stream)
 {
     $streamEvents = $stream->streamEvents();
     $streamEvents->rewind();
     $this->streams[$stream->streamName()->toString()] = $streamEvents;
 }
 /**
  * @param Stream $stream
  * @throws RuntimeException If creation of stream fails
  * @return void
  */
 public function create(Stream $stream)
 {
     if (!$stream->streamEvents()->valid()) {
         throw new RuntimeException(sprintf("Cannot create empty stream %s. %s requires at least one event to extract metadata information", $stream->streamName()->toString(), __CLASS__));
     }
     $streamName = $stream->streamName();
     $this->createIndexes($streamName);
     $this->appendTo($streamName, $stream->streamEvents());
 }
Ejemplo n.º 5
0
 /**
  * @param Stream $stream
  * @return void
  */
 public function create(Stream $stream)
 {
     $this->streams[$stream->streamName()->toString()] = $stream->streamEvents();
 }