You are here

final class TeamMemberApiProductAccessHandlerCacheReset in Apigee Edge 8

Ensures team member API product access handler's cache gets cleared.

Hierarchy

Expanded class hierarchy of TeamMemberApiProductAccessHandlerCacheReset

1 string reference to 'TeamMemberApiProductAccessHandlerCacheReset'
apigee_edge_teams.services.yml in modules/apigee_edge_teams/apigee_edge_teams.services.yml
modules/apigee_edge_teams/apigee_edge_teams.services.yml
1 service uses TeamMemberApiProductAccessHandlerCacheReset
apigee_edge_teams.event_subscriber.team_member_api_product_access_handler_cache_reset in modules/apigee_edge_teams/apigee_edge_teams.services.yml
Drupal\apigee_edge_teams\EventSubscriber\TeamMemberApiProductAccessHandlerCacheReset

File

modules/apigee_edge_teams/src/EventSubscriber/TeamMemberApiProductAccessHandlerCacheReset.php, line 35

Namespace

Drupal\apigee_edge_teams\EventSubscriber
View source
final class TeamMemberApiProductAccessHandlerCacheReset implements EventSubscriberInterface {

  /**
   * The team member api product access handler.
   *
   * @var \Drupal\apigee_edge_teams\TeamMemberApiProductAccessHandlerInterface
   */
  private $teamMemberApiProductAccessHandler;

  /**
   * TeamApiProductAccessCacheReset constructor.
   *
   * @param \Drupal\apigee_edge_teams\TeamMemberApiProductAccessHandlerInterface $team_member_api_product_access_handler
   *   The team member api product access handler.
   */
  public function __construct(TeamMemberApiProductAccessHandlerInterface $team_member_api_product_access_handler) {
    $this->teamMemberApiProductAccessHandler = $team_member_api_product_access_handler;
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    return [
      AppCredentialCreateEvent::EVENT_NAME => 'clearApiProductCache',
      AppCredentialGenerateEvent::EVENT_NAME => 'clearApiProductCache',
      AppCredentialDeleteEvent::EVENT_NAME => 'clearApiProductCache',
      AppCredentialAddApiProductEvent::EVENT_NAME => 'clearApiProductCache',
      AppCredentialDeleteApiProductEvent::EVENT_NAME => 'clearApiProductCache',
    ];
  }

  /**
   * Clears API product entity access cache.
   *
   * @param \Symfony\Component\EventDispatcher\Event $event
   *   Event that triggered this subscriber.
   */
  public function clearApiProductCache(Event $event) : void {
    $this->teamMemberApiProductAccessHandler
      ->resetCache();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TeamMemberApiProductAccessHandlerCacheReset::$teamMemberApiProductAccessHandler private property The team member api product access handler.
TeamMemberApiProductAccessHandlerCacheReset::clearApiProductCache public function Clears API product entity access cache.
TeamMemberApiProductAccessHandlerCacheReset::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to.
TeamMemberApiProductAccessHandlerCacheReset::__construct public function TeamApiProductAccessCacheReset constructor.