Cache\Adapter\MongoDB\Tests\CreateServerTrait::getCollection PHP Метод

getCollection() публичный Метод

public getCollection ( ) : mixed
Результат mixed
    public function getCollection()
    {
        if ($this->collection === null) {
            $manager = new Manager('mongodb://' . getenv('MONGODB_HOST'));
            // In your own code, only do this *once* to initialize your cache
            $this->collection = MongoDBCachePool::createCollection($manager, getenv('MONGODB_DATABASE'), getenv('MONGODB_COLLECTION'));
        }
        return $this->collection;
    }
CreateServerTrait