You are here

function oauth2_server_scope_load in OAuth2 Server 7

Loads a single scope entity.

Parameters

string $server: The server machine name.

string $name: The scope machine name.

Return value

OAuth2ServerScope|FALSE The scope entity, or FALSE if not found.

2 calls to oauth2_server_scope_load()
oauth2_server_scope_exists in includes/oauth2_server.scope_admin.inc
Check whether a given scope exists.
Scope::getDefaultScope in lib/Drupal/oauth2_server/Scope.php

File

./oauth2_server.module, line 464
Provides OAuth2 server functionality.

Code

function oauth2_server_scope_load($server, $name) {
  $values = array(
    'server' => $server,
    'name' => $name,
  );
  $scopes = oauth2_server_entity_load_by_properties('oauth2_server_scope', $values);
  return $scopes ? reset($scopes) : FALSE;
}