You are here

WebformProtectedDownloadsStorage.php in Webform Protected Downloads 8

File

src/WebformProtectedDownloadsStorage.php
View source
<?php

namespace Drupal\webform_protected_downloads;

use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\webform\Entity\WebformSubmission;
class WebformProtectedDownloadsStorage extends SqlContentEntityStorage implements WebformProtectedDownloadsStorageInterface {
  public function getByHash(string $hash) {
    return $this
      ->loadByProperties([
      'hash' => $hash,
    ]);
  }
  public function getByWebformSubmission(WebformSubmission $webformSubmission) {
    return $this
      ->loadByProperties([
      'webform_submission' => $webformSubmission
        ->id(),
    ]);
  }

}