You are here

public function Scope::id in OAuth2 Server 8

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

Gets the identifier.

Return value

string|int|null The entity identifier, or NULL if the object does not yet have an identifier.

Overrides EntityBase::id

1 call to Scope::id()
Scope::isDefault in src/Entity/Scope.php
Returns whether the scope is the default server scope.

File

src/Entity/Scope.php, line 93

Class

Scope
Defines the OAuth2 scope entity.

Namespace

Drupal\oauth2_server\Entity

Code

public function id() {
  if (!empty($this->server_id) && !empty($this->scope_id)) {
    return $this->server_id . '_' . $this->scope_id;
  }
  return isset($this->id) ? $this->id : NULL;
}