LdapTools\Connection\LdapConnection::__construct PHP Method

__construct() public method

public __construct ( DomainConfiguration $config, LdapTools\Event\EventDispatcherInterface $dispatcher = null, LdapTools\Log\LdapLoggerInterface $logger = null )
$config LdapTools\DomainConfiguration
$dispatcher LdapTools\Event\EventDispatcherInterface
$logger LdapTools\Log\LdapLoggerInterface
    public function __construct(DomainConfiguration $config, EventDispatcherInterface $dispatcher = null, LdapLoggerInterface $logger = null)
    {
        $this->usernameFormatter = BindUserStrategy::getInstance($config);
        $this->serverPool = new LdapServerPool($config);
        $this->config = $config;
        $this->dispatcher = $dispatcher ?: new SymfonyEventDispatcher();
        $this->logger = $logger;
        $this->setupOperationInvoker();
        $this->serverPool->setSelectionMethod($config->getServerSelection());
        if (!$config->getLazyBind()) {
            $this->connect();
        }
    }