You are here

class ClientEntity 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
  2. 8.2 src/Entities/ClientEntity.php \Drupal\simple_oauth\Entities\ClientEntity
  3. 8.3 src/Entities/ClientEntity.php \Drupal\simple_oauth\Entities\ClientEntity

Hierarchy

Expanded class hierarchy of ClientEntity

1 file declares its use of ClientEntity
ClientRepository.php in src/Repositories/ClientRepository.php

File

src/Entities/ClientEntity.php, line 9

Namespace

Drupal\simple_oauth\Entities
View source
class ClientEntity implements ClientEntityInterface {
  use EntityTrait, ClientTrait;

  /**
   * @var \Drupal\consumers\Entity\Consumer
   */
  protected $entity;

  /**
   * ClientEntity constructor.
   *
   * @param \Drupal\consumers\Entity\Consumer $entity
   *   The Drupal entity.
   */
  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;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function setName($name) {
    $this->name = $name;
  }

  /**
   * {@inheritdoc}
   */
  public function getDrupalEntity() {
    return $this->entity;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ClientEntity::$entity protected property
ClientEntity::getDrupalEntity public function Returns the associated Drupal entity. Overrides ClientEntityInterface::getDrupalEntity
ClientEntity::setName public function Set the name of the client. Overrides ClientEntityInterface::setName
ClientEntity::__construct public function ClientEntity constructor.