You are here

public function ClientEntity::__construct in Simple OAuth (OAuth2) & OpenID Connect 5.x

Same name and namespace in other branches
  1. 8.4 src/Entities/ClientEntity.php \Drupal\simple_oauth\Entities\ClientEntity::__construct()
  2. 8.2 src/Entities/ClientEntity.php \Drupal\simple_oauth\Entities\ClientEntity::__construct()
  3. 8.3 src/Entities/ClientEntity.php \Drupal\simple_oauth\Entities\ClientEntity::__construct()

ClientEntity constructor.

Parameters

\Drupal\consumers\Entity\Consumer $entity: The Drupal entity.

File

src/Entities/ClientEntity.php, line 24

Class

ClientEntity

Namespace

Drupal\simple_oauth\Entities

Code

public function __construct(Consumer $entity) {
  $this->entity = $entity;
  $this
    ->setIdentifier($entity
    ->uuid());
  $this
    ->setName($entity
    ->label());
  if ($entity
    ->hasField('redirect')) {
    $this->redirectUri = $entity
      ->get('redirect')->value;
  }
}