Firestore/src/SnapshotTrait.php
private function getCollectionReference(
        ConnectionInterface $connection,
        ValueMapper $mapper,
        $projectId,
        $database,
        $name
    ) {
        if ($this->isRelative($name)) {
            $name = $this->fullName($projectId, $database, $name);
        }

        if (!$this->isCollection($name)) {
            throw new \InvalidArgumentException(sprintf(
                'Given path `%s` is not a valid collection path.',
                $name
            ));
        }

        return new CollectionReference($connection, $mapper, $name);
    }
private function getCollectionReference(
        ConnectionInterface $connection,
        ValueMapper $mapper,
        $projectId,
        $database,
        $name
    ) {
        if ($this->isRelative($name)) {
            $name = $this->fullName($projectId, $database, $name);
        }

        if (!$this->isCollection($name)) {
            throw new \InvalidArgumentException(sprintf(
                'Given path `%s` is not a valid collection path.',
                $name
            ));
        }

        return new CollectionReference($connection, $mapper, $name);
    }
private function getCollectionReference ( ConnectionInterface $ connection , ValueMapper $ mapper , $ projectId , $ database , $ name ) { if ( $ this -> isRelative ( $ name ) ) { $ name = $ this -> fullName ( $ projectId , $ database , $ name ) ; } if ( ! $ this -> isCollection ( $ name ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Given path `%s` is not a valid collection path.' , $ name ) ) ; } return new CollectionReference ( $ connection , $ mapper , $ name ) ; }
Creates a CollectionReference object.

@param ConnectionInterface $connection A connection to Cloud Firestore.
@param ValueMapper $mapper A Firestore value mapper.
@param string $projectId The current project id.
@param string $database The database id.
@param string $name The collection name, in absolute form, or relative to the database.
@return CollectionReference
@throws InvalidArgumentException if an invalid path is provided.
Creates a CollectionReference object .