original_string: public function createSnapshot(AggregateId $aggregateId) : void
      {
          if (!$this->eventSourced($aggregateId)) {
              return;
          }
          /* @var $aggregateRoot EventSourcedAggregateRoot */
          $aggregateRoot = $this->loadSnapshot($aggregateId);
          $stateHash = $aggregateRoot === null ? null : $aggregateRoot->stateHash();
          $events = $this->getEventsFor($aggregateId, $stateHash);
          if ($events->count() == 0) {
              return;
          }
          if ($aggregateRoot === null) {
              $aggregateRoot = ObjectClass::forName($aggregateId->aggregateClass())->newInstanceWithoutConstructor();
          }
          $aggregateRoot->loadFromHistory($events);
          $this->doCreateSnapshot($aggregateRoot);
      }
code: public function createSnapshot(AggregateId $aggregateId) : void
      {
          if (!$this->eventSourced($aggregateId)) {
              return;
          }
          /* @var $aggregateRoot EventSourcedAggregateRoot */
          $aggregateRoot = $this->loadSnapshot($aggregateId);
          $stateHash = $aggregateRoot === null ? null : $aggregateRoot->stateHash();
          $events = $this->getEventsFor($aggregateId, $stateHash);
          if ($events->count() == 0) {
              return;
          }
          if ($aggregateRoot === null) {
              $aggregateRoot = ObjectClass::forName($aggregateId->aggregateClass())->newInstanceWithoutConstructor();
          }
          $aggregateRoot->loadFromHistory($events);
          $this->doCreateSnapshot($aggregateRoot);
      }
code_tokens: public function createSnapshot ( AggregateId $ aggregateId ) : void { if ( ! $ this -> eventSourced ( $ aggregateId ) ) { return ; } /* @var $aggregateRoot EventSourcedAggregateRoot */ $ aggregateRoot = $ this -> loadSnapshot ( $ aggregateId ) ; $ stateHash = $ aggregateRoot === null ? null : $ aggregateRoot -> stateHash ( ) ; $ events = $ this -> getEventsFor ( $ aggregateId , $ stateHash ) ; if ( $ events -> count ( ) == 0 ) { return ; } if ( $ aggregateRoot === null ) { $ aggregateRoot = ObjectClass :: forName ( $ aggregateId -> aggregateClass ( ) ) -> newInstanceWithoutConstructor ( ) ; } $ aggregateRoot -> loadFromHistory ( $ events ) ; $ this -> doCreateSnapshot ( $ aggregateRoot ) ; }
docstring: Events raised in the current transaction are not being stored in this snapshot.
  Only the already persisted events are being utilized.
  
  @param AggregateId $aggregateId
docstring_tokens: Events raised in the current transaction are not being stored in this snapshot . Only the already persisted events are being utilized .