Author: Alexander Miertsch (kontakt@codeliner.ws)
コード例 #1
0
 /**
  * @param Stream $stream
  * @throws \Prooph\EventStore\Exception\RuntimeException
  * @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());
 }
コード例 #3
0
 /**
  * @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());
 }
コード例 #4
0
 /**
  * @param Stream $stream
  * @return void
  */
 public function create(Stream $stream)
 {
     $streamEvents = $stream->streamEvents();
     $streamEvents->rewind();
     $this->streams[$stream->streamName()->toString()] = $streamEvents;
 }
コード例 #5
0
ファイル: InMemoryAdapter.php プロジェクト: ad3n/event-store
 /**
  * @param Stream $stream
  * @return void
  */
 public function create(Stream $stream)
 {
     $this->streams[$stream->streamName()->toString()] = $stream->streamEvents();
 }