AppdataPreviewObjectStoreStorage.php 675 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Files\ObjectStore;
  8. class AppdataPreviewObjectStoreStorage extends ObjectStoreStorage {
  9. private string $internalId;
  10. /**
  11. * @param array $params
  12. * @throws \Exception
  13. */
  14. public function __construct($params) {
  15. if (!isset($params['internal-id'])) {
  16. throw new \Exception('missing id in parameters');
  17. }
  18. $this->internalId = (string)$params['internal-id'];
  19. parent::__construct($params);
  20. }
  21. public function getId(): string {
  22. return 'object::appdata::preview:' . $this->internalId;
  23. }
  24. }