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