Imbo\Database\MongoDB::getCollection PHP Method

getCollection() private method

Get the mongo collection instance
private getCollection ( string $type ) : MongoCollection
$type string "image" or "shortUrl"
return MongoCollection
    private function getCollection($type)
    {
        if ($this->collections[$type] === null) {
            try {
                $this->collections[$type] = $this->getMongoClient()->selectCollection($this->params['databaseName'], $type);
            } catch (MongoException $e) {
                throw new DatabaseException('Could not select collection', 500, $e);
            }
        }
        return $this->collections[$type];
    }