You are here

public function Scope::__construct in OAuth2 Server 8

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

Constructs an Entity object.

Parameters

array $values: An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

string $entity_type: The type of the entity to create.

Overrides ConfigEntityBase::__construct

File

src/Entity/Scope.php, line 140

Class

Scope
Defines the OAuth2 scope entity.

Namespace

Drupal\oauth2_server\Entity

Code

public function __construct(array $values, $entity_type) {
  if (isset($values['server_id']) && isset($values['scope_id'])) {
    $values['id'] = $values['server_id'] . '_' . $values['scope_id'];
  }
  parent::__construct($values, $entity_type);
}