You are here

public function LdapBridge::setServerById in Lightweight Directory Access Protocol (LDAP) 8.4

Set Server by ID.

Parameters

string $sid: Server machine name.

Overrides LdapBridgeInterface::setServerById

File

ldap_servers/src/LdapBridge.php, line 83

Class

LdapBridge
Ldap Bridge to symfony/ldap.

Namespace

Drupal\ldap_servers

Code

public function setServerById(string $sid) : void {
  $server = $this->entityManager
    ->load($sid);

  /** @var \Drupal\ldap_servers\Entity\Server $server */
  if ($server) {
    $this
      ->setServer($server);
  }
}