You are here

public function AuthorizationProfile::getConsumer in Authorization 8

Get the active consumer.

Return value

\Drupal\authorization\consumer\ConsumerInterface|null The active consumer.

2 calls to AuthorizationProfile::getConsumer()
AuthorizationProfile::checkConditions in src/Entity/AuthorizationProfile.php
Check if the profile is available.
AuthorizationProfile::grantsAndRevokes in src/Entity/AuthorizationProfile.php
Perform grant and revokes.

File

src/Entity/AuthorizationProfile.php, line 251

Class

AuthorizationProfile
Defines the Authorization profile entity.

Namespace

Drupal\authorization\Entity

Code

public function getConsumer() : ?ConsumerInterface {
  if (!$this->consumer_plugin || $this
    ->getConsumerId() !== $this->consumer_plugin
    ->getPluginId()) {
    $this
      ->loadConsumerPlugin();
  }
  return $this->consumer_plugin;
}