setSelectionMethod() public method

Set the selection method for checking servers (ie. 'random', 'order').
public setSelectionMethod ( string $method )
$method string
示例#1
0
 /**
  * @param DomainConfiguration $config
  * @param EventDispatcherInterface $dispatcher
  * @param LdapLoggerInterface $logger
  */
 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();
     }
 }