Set the MongoClient instance to wrap.

@deprecated 1.1 Will be removed for 2.0
@param \MongoClient $mongoClient
967470
public function setMongo($mongoClient)
    {
        if ( ! ($mongoClient instanceof \MongoClient || $mongoClient instanceof \Mongo)) {
            throw new \InvalidArgumentException('MongoClient or Mongo instance required');
        }

        $this->mongoClient = $mongoClient;
    }
1277723
public function setHttpClient($httpClient = null)
    {
        if ($httpClient === null)
        {
            $this->_httpClient = new CurlClient($this->_apiKey, $this->_siteID);
            return;
        }
        $httpClient->setCredentials($this->_apiKey, $this->_siteID);
        $this->_httpClient = $httpClient;
    }
838568
public function setClientEncType(\Zend\Http\Client $client)
    {
        // Setting EncType to UrlEncoded
        $client->setEncType(\Zend\Http\Client::ENC_URLENCODED);

        return $client;
    }
1232996
protected function makeServicesClient(Client $client)
    {
        $parameters = $this->getDescription();

        $description = new Description($parameters);

        return new GuzzleClient($client, $description);
    }
597449
public function setCollector(ResourceCollectorInterface $collector)
    {
        $this->collector = $collector;

        if ($this->loader) {
            if ($this->loader instanceof ResourceAwareInterface) {
                $this->loader->setResourceCollector($collector);
            }

            if ($this->loader instanceof DelegatingLoader) {
                $resolver = $this->loader->getResolver();

                if ($resolver instanceof ResourceAwareInterface) {
                    $resolver->setResourceCollector($collector);
                }
            }
        }
    }
983185
@SuppressWarnings("unused")
  public synchronized void setDefaultHttpClient(CloseableHttpClient httpClient) {
    Objects.requireNonNull(httpClient);
    close();
    HttpExecutorFactory.httpClient = httpClient;
  }
836503
public function setClient(AbstractClient $client)
    {
        if (false === $client instanceof Svn) {
            throw new \InvalidArgumentException(sprintf('Expected argument $client to be Webcreate\Vcs\Svn instead %s given.', get_class($client)));
        }

        $this->client = $client;

        return $this;
    }
325501
public function apply(object $object, ReflectionProperty $reflectionProperty, callable $objectCopier): void
    {
        $reflectionProperty->setAccessible(true);
        /** @var Collection $oldCollection */
        $oldCollection = $reflectionProperty->getValue($object);

        $newCollection = $oldCollection->map(
            function ($item) use ($objectCopier) {
                return $objectCopier($item);
            }
        );

        $reflectionProperty->setValue($object, $newCollection);
    }
862072
public function useHttpClient($httpClient): self
    {
        if (!$httpClient instanceof ClientInterface && !$httpClient instanceof HttpClient) {
            throw new \LogicException('Client must be an instance of Http\\Client\\HttpClient or Psr\\Http\\Client\\ClientInterface');
        }

        $this->httpClient = $httpClient;

        return $this;
    }
1014860
public MongoClient createMongoClient(MongoClientSettings settings) {
		Integer embeddedPort = getEmbeddedPort();
		if (embeddedPort != null) {
			return createEmbeddedMongoClient(settings, embeddedPort);
		}
		return createNetworkMongoClient(settings);
	}
83234
private function initializeClient($url, ClientInterface $client = null)
    {
        if ($client) {
            $this->client = $client;
        } else {
            $this->client = new LocalClient($url);
        }
    }
894196
public function setCasServer($server)
    {
        $this->casServer = $server;
        $this->guzzleClient = new Client(['base_uri' => $server, 'cookies' => true]);
    }
1135313
public function client($client)
    {
        $this->client = $client instanceof Client ? $client : bearychat($client);

        if ($this->message) {
            $this->message->setClient($this->client);
        }

        return $this;
    }
885884
public function setClient(\Yurun\Swoole\SharedMemory\Client\Client $client)
    {
        $this->client = $client;

        return $this;
    }
1037954
public function setInternalId($id)
    {
        if ($this->_id !== null && $this->_id !== $id) {
            throw new ClientException('Should not update the id of an existing document');
        }


        if (!preg_match('/^[a-zA-Z0-9_-]{1,64}\/[a-zA-Z0-9_:.@\-()+,=;$!*\'%]{1,254}$/', $id)) {
            throw new ClientException('Invalid format for document id');
        }

        $this->_id = (string) $id;
    }
265486
public function setRedis(?RedisClient $redis = null)
    {
        if (! $redis) {
            $server = Arr::get($this->config, 'server', []);
            $options = Arr::get($this->config, 'options', []);

            // forbid setting prefix from options
            if (Arr::has($options, 'prefix')) {
                $options = Arr::except($options, 'prefix');
            }

            $redis = new RedisClient($server, $options);
        }

        $this->redis = $redis;
    }
283695
private static function constructMongoClient($uri, $options)
    {
        if (isset($uri)) {
            if (isset($options)) {
                return new MongoClient($uri, $options);
            }
            return new MongoClient($uri);
        }
        return new MongoClient();
    }