Prooph\EventStore\Stream\Stream::streamEvents PHP Метод

streamEvents() публичный Метод

public streamEvents ( ) : Iterato\Iterator
Результат Iterato\Iterator
    public function streamEvents()
    {
        return $this->streamEvents;
    }

Usage Example

 /**
  * @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());
 }
All Usage Examples Of Prooph\EventStore\Stream\Stream::streamEvents