Firestore/src/SnapshotTrait.php
private function createSnapshot(
        ConnectionInterface $connection,
        ValueMapper $valueMapper,
        DocumentReference $reference,
        array $options = []
    ) {
        $document = [];
        $fields = [];
        $exists = true;

        try {
            $document = $this->getSnapshot($connection, $reference->name(), $options);
        } catch (NotFoundException $e) {
            $exists = false;
        }

        return $this->createSnapshotWithData($valueMapper, $reference, $document, $exists);
    }
private function createSnapshot(
        ConnectionInterface $connection,
        ValueMapper $valueMapper,
        DocumentReference $reference,
        array $options = []
    ) {
        $document = [];
        $fields = [];
        $exists = true;

        try {
            $document = $this->getSnapshot($connection, $reference->name(), $options);
        } catch (NotFoundException $e) {
            $exists = false;
        }

        return $this->createSnapshotWithData($valueMapper, $reference, $document, $exists);
    }
private function createSnapshot ( ConnectionInterface $ connection , ValueMapper $ valueMapper , DocumentReference $ reference , array $ options = [ ] ) { $ document = [ ] ; $ fields = [ ] ; $ exists = true ; try { $ document = $ this -> getSnapshot ( $ connection , $ reference -> name ( ) , $ options ) ; } catch ( NotFoundException $ e ) { $ exists = false ; } return $ this -> createSnapshotWithData ( $ valueMapper , $ reference , $ document , $ exists ) ; }
Execute a service request to retrieve a document snapshot.

@param ConnectionInterface $connection A Connection to Cloud Firestore.
@param ValueMapper $valueMapper A Firestore Value Mapper.
@param DocumentReference $reference The parent document.
@param array $options {
Configuration Options

@type string $transaction The transaction ID to fetch the snapshot.
}
@return DocumentSnapshot
Execute a service request to retrieve a document snapshot .