You are here

public function Server::getFormattedBind in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.3 ldap_servers/src/Entity/Server.php \Drupal\ldap_servers\Entity\Server::getFormattedBind()

Returns the formatted label of the bind method.

Return value

string The formatted text for the current bind.

Overrides ServerInterface::getFormattedBind

File

ldap_servers/src/Entity/Server.php, line 372

Class

Server
Defines the Server entity.

Namespace

Drupal\ldap_servers\Entity

Code

public function getFormattedBind() : TranslatableMarkup {
  switch ($this
    ->get('bind_method')) {
    case 'service_account':
    default:
      $namedBind = $this
        ->t('service account bind');
      break;
    case 'user':
      $namedBind = $this
        ->t('user credentials bind');
      break;
    case 'anon':
      $namedBind = $this
        ->t('anonymous bind (search), then user credentials');
      break;
    case 'anon_user':
      $namedBind = $this
        ->t('anonymous bind');
      break;
  }
  return $namedBind;
}