You are here

public function ServerFactory::getServerByIdEnabled in Lightweight Directory Access Protocol (LDAP) 8.3

Fetch server by ID if enabled.

Parameters

string $sid: Server id.

Return value

bool|EntityInterface|\Drupal\ldap_servers\Entity\Server Server entity if enabled or false.

1 call to ServerFactory::getServerByIdEnabled()
ServerFactory::getUserDataFromServerByIdentifier in ldap_servers/src/ServerFactory.php
Fetch user data from server by Identifier.

File

ldap_servers/src/ServerFactory.php, line 66

Class

ServerFactory
Helper class to working with the Server classes.

Namespace

Drupal\ldap_servers

Code

public function getServerByIdEnabled($sid) {
  $server = $this->entityManager
    ->load($sid);
  if ($server && $server
    ->status()) {
    return $server;
  }
  else {
    return FALSE;
  }
}