Firestore/src/SnapshotTrait.php
private function getSnapshot(ConnectionInterface $connection, $name, array $options = [])
    {
        if (isset($options['readTime'])) {
            if (!($options['readTime'] instanceof Timestamp)) {
                throw new \InvalidArgumentException(sprintf(
                    '`$options.readTime` must be an instance of %s',
                    Timestamp::class
                ));
            }

            $options['readTime'] = $options['readTime']->formatForApi();
        }

        $snapshot = $connection->batchGetDocuments([
            'database' => $this->databaseFromName($name),
            'documents' => [$name],
        ] + $options)->current();

        if (!isset($snapshot['found'])) {
            throw new NotFoundException(sprintf(
                'Document %s does not exist',
                $name
            ));
        }

        return $snapshot['found'];
    }
private function getSnapshot(ConnectionInterface $connection, $name, array $options = [])
    {
        if (isset($options['readTime'])) {
            if (!($options['readTime'] instanceof Timestamp)) {
                throw new \InvalidArgumentException(sprintf(
                    '`$options.readTime` must be an instance of %s',
                    Timestamp::class
                ));
            }

            $options['readTime'] = $options['readTime']->formatForApi();
        }

        $snapshot = $connection->batchGetDocuments([
            'database' => $this->databaseFromName($name),
            'documents' => [$name],
        ] + $options)->current();

        if (!isset($snapshot['found'])) {
            throw new NotFoundException(sprintf(
                'Document %s does not exist',
                $name
            ));
        }

        return $snapshot['found'];
    }
private function getSnapshot ( ConnectionInterface $ connection , $ name , array $ options = [ ] ) { if ( isset ( $ options [ 'readTime' ] ) ) { if ( ! ( $ options [ 'readTime' ] instanceof Timestamp ) ) { throw new \ InvalidArgumentException ( sprintf ( '`$options.readTime` must be an instance of %s' , Timestamp :: class ) ) ; } $ options [ 'readTime' ] = $ options [ 'readTime' ] -> formatForApi ( ) ; } $ snapshot = $ connection -> batchGetDocuments ( [ 'database' => $ this -> databaseFromName ( $ name ) , 'documents' => [ $ name ] , ] + $ options ) -> current ( ) ; if ( ! isset ( $ snapshot [ 'found' ] ) ) { throw new NotFoundException ( sprintf ( 'Document %s does not exist' , $ name ) ) ; } return $ snapshot [ 'found' ] ; }
Send a service request for a snapshot, and return the raw data

@param ConnectionInterface $connection A Connection to Cloud Firestore
@param string $name The document name.
@param array $options Configuration options.
@return array
@throws \InvalidArgumentException if an invalid `$options.readTime` is specified.
@throws NotFoundException If the document does not exist.
Send a service request for a snapshot and return the raw data