PubSub/src/Snapshot.php
public function topic()
    {
        if ($this->info['topic']) {
            return new Topic(
                $this->connection,
                $this->projectId,
                $this->info['topic'],
                $this->encode,
                [],
                $this->clientConfig
            );
        }

        return null;
    }
public function topic()
    {
        if ($this->info['topic']) {
            return new Topic(
                $this->connection,
                $this->projectId,
                $this->info['topic'],
                $this->encode,
                [],
                $this->clientConfig
            );
        }

        return null;
    }
public function topic ( ) { if ( $ this -> info [ 'topic' ] ) { return new Topic ( $ this -> connection , $ this -> projectId , $ this -> info [ 'topic' ] , $ this -> encode , [ ] , $ this -> clientConfig ) ; } return null ; }
Get the Topic attached to the snapshot, if one exists.

Example:
```
$topic = $snapshot->topic();
```

@return Topic|null
Get the Topic attached to the snapshot if one exists .