LdapTools\Configuration::setDefaultDomain PHP 메소드

setDefaultDomain() 공개 메소드

Set the default domain that should be used by the LdapManager. In the absence of multiple domains, this does not have to be set.
public setDefaultDomain ( $domain )
$domain
    public function setDefaultDomain($domain)
    {
        $this->config['defaultDomain'] = $domain;
        return $this;
    }

Usage Example

예제 #1
0
 function it_should_honor_the_default_domain_configuration_option()
 {
     $config = new Configuration();
     $domain = new DomainConfiguration('example.com');
     $domain->setServers(['example'])->setLazyBind(true)->setBaseDn('dc=example,dc=com');
     $anotherDomain = new DomainConfiguration('test.com');
     $anotherDomain->setServers(['test'])->setLazyBind(true)->setBaseDn('dc=test,dc=com');
     $config->addDomain($domain, $anotherDomain);
     $config->setDefaultDomain('test.com');
     $this->beConstructedWith($config);
     $this->getDomainContext()->shouldBeEqualTo('test.com');
 }