Skip to content
Snippets Groups Projects

D9 readiness

10 files
+ 50
75
Compare changes
  • Side-by-side
  • Inline
Files
10
@@ -2,20 +2,14 @@
namespace Drupal\webform_encrypt;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Database\Connection;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\encrypt\EncryptionProfileInterface;
use Drupal\encrypt\EncryptServiceInterface;
use Drupal\webform\WebformAccessRulesManagerInterface;
use Drupal\encrypt\Entity\EncryptionProfile;
use Drupal\webform\WebformInterface;
use Drupal\webform\WebformSubmissionInterface;
use Drupal\webform\WebformSubmissionStorage;
use Drupal\encrypt\Entity\EncryptionProfile;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
@@ -31,45 +25,22 @@ class WebformEncryptSubmissionStorage extends WebformSubmissionStorage {
protected $encryptionService;
/**
* WebformEncryptSubmissionStorage constructor.
*
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type definition.
* @param \Drupal\Core\Database\Connection $database
* The database connection to be used.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
* @param \Drupal\Core\Cache\CacheBackendInterface $cache
* The cache backend to be used.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Session\AccountProxyInterface $current_user
* Proxied implementation of AccountInterface, to access current user data.
* @param \Drupal\webform\WebformAccessRulesManagerInterface $access_rules_manager
* The webform access rules manager.
* @param \Drupal\encrypt\EncryptServiceInterface $encryptService
* The encryption Service.
* {@inheritdoc}
*/
public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityTypeManagerInterface $entity_type_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, AccountProxyInterface $current_user, WebformAccessRulesManagerInterface $access_rules_manager, EncryptServiceInterface $encryptService) {
parent::__construct($entity_type, $database, $entity_type_manager, $cache, $language_manager, $current_user, $access_rules_manager);
$this->encryptionService = $encryptService;
public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
$instance = parent::createInstance($container, $entity_type);
$instance->setEncryptionService($container->get('encryption'));
return $instance;
}
/**
* {@inheritdoc}
* Set the encryption service.
*
* @param \Drupal\encrypt\EncryptServiceInterface $encryptionService
* The encryption service.
*/
public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
return new static(
$entity_type,
$container->get('database'),
$container->get('entity.manager'),
$container->get('cache.entity'),
$container->get('language_manager'),
$container->get('current_user'),
$container->get('webform.access_rules_manager'),
$container->get('encryption')
);
public function setEncryptionService(EncryptServiceInterface $encryptionService) {
$this->encryptionService = $encryptionService;
}
/**
Loading