public function take(StreamName $streamName, AggregateRootInterface $aggregate, DomainMessage $message)
    {
        $id = $aggregate->getAggregateRootId();

        if (!$this->strategy->isFulfilled($streamName, $aggregate)) {
            return false;
        }

        if (!$this->snapshotStore->has($id, $message->getVersion())) {
            $this->snapshotStore->save(Snapshot::take($id, $aggregate, $message->getVersion()));
        }

        return true;
    }
public function take(StreamName $streamName, AggregateRootInterface $aggregate, DomainMessage $message)
    {
        $id = $aggregate->getAggregateRootId();

        if (!$this->strategy->isFulfilled($streamName, $aggregate)) {
            return false;
        }

        if (!$this->snapshotStore->has($id, $message->getVersion())) {
            $this->snapshotStore->save(Snapshot::take($id, $aggregate, $message->getVersion()));
        }

        return true;
    }
public function take ( StreamName $ streamName , AggregateRootInterface $ aggregate , DomainMessage $ message ) { $ id = $ aggregate -> getAggregateRootId ( ) ; if ( ! $ this -> strategy -> isFulfilled ( $ streamName , $ aggregate ) ) { return false ; } if ( ! $ this -> snapshotStore -> has ( $ id , $ message -> getVersion ( ) ) ) { $ this -> snapshotStore -> save ( Snapshot :: take ( $ id , $ aggregate , $ message -> getVersion ( ) ) ) ; } return true ; }
Takes a snapshot
@param StreamName $streamName
@param AggregateRootInterface $aggregate
@param DomainMessage $message - The domain message
@return bool
Takes a snapshot