sessionless-1.x-dev/modules/sessionless_session/src/SessionlessStickyQueryFactory.php

modules/sessionless_session/src/SessionlessStickyQueryFactory.php
<?php

namespace Drupal\sessionless_session;

use Drupal\sessionless\SessionlessEncryptAndSign;
use Drupal\sticky_query\StickyQuery\StickyQueryAppDrivenValueHandler;
use Drupal\sticky_query\StickyQuery\StickyQueryHandlerFactoryInterface;
use Drupal\sticky_query\StickyQuery\StickyQueryHandlerRegistry;
use Drupal\sticky_query\StickyQueryStorage\StickyQueryNamespacedStorageInterface;

class SessionlessStickyQueryFactory implements StickyQueryHandlerFactoryInterface {

  public function __construct(
    protected SessionlessEncryptAndSign $cryptoService,
    protected StickyQueryNamespacedStorageInterface $storage,
  ) {}

  public function registerHandlers(StickyQueryHandlerRegistry $registry): void {
    $storage = new StickyQueryStorageEncryptionDecorator(
     $this->storage,
     $this->cryptoService
    );
    $registry->add(new StickyQueryAppDrivenValueHandler('sessionless', $storage));
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc