Adldap\Connections\Provider::setConnection PHP Method

setConnection() public method

public setConnection ( Adldap\Connections\ConnectionInterface $connection = null )
$connection Adldap\Connections\ConnectionInterface
    public function setConnection(ConnectionInterface $connection = null)
    {
        // We'll create a standard connection if one isn't given.
        $this->connection = $connection ?: new Ldap();
        // Prepare the connection.
        $this->prepareConnection();
        // Instantiate the LDAP connection.
        $this->connection->connect($this->configuration->get('domain_controllers'), $this->configuration->get('port'));
        return $this;
    }