You are here

function oauth2_server_oauth2_server_scope_update in OAuth2 Server 7

Implements hook_oauth2_server_scope_update().

i18n_string integration for oauth2_server_scope.

File

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

Code

function oauth2_server_oauth2_server_scope_update($scope) {
  if (module_exists('i18n_string')) {

    // Account for name changes.
    if ($scope->original->name != $scope->name) {
      $old_context = "oauth2_server:oauth2_server_scope:{$scope->original->name}:*";
      $new_context = "oauth2_server:oauth2_server_scope:{$scope->name}:*";
      i18n_string_update_context($old_context, $new_context);
    }
    i18n_string_object_update('oauth2_server_scope', $scope);
  }
}