You are here

public function Client::getServer in OAuth2 Server 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Client.php \Drupal\oauth2_server\Entity\Client::getServer()

Returns the server the client belongs to.

Return value

\Drupal\oauth2_server\ServerInterface Returns the server object the client belongs to.

Overrides ClientInterface::getServer

File

src/Entity/Client.php, line 132

Class

Client
Defines the OAuth2 client entity.

Namespace

Drupal\oauth2_server\Entity

Code

public function getServer() {
  if (!$this->server && $this->server_id) {
    $this->server = \Drupal::entityTypeManager()
      ->getStorage('oauth2_server')
      ->load($this->server_id);
  }
  return $this->server;
}