mirror of
https://github.com/nextcloud/tables.git
synced 2026-01-17 13:31:56 +00:00
59 lines
1.4 KiB
PHP
59 lines
1.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OCA\Tables\Reference;
|
|
|
|
use OC\Collaboration\Reference\ReferenceManager;
|
|
use OCP\Collaboration\Reference\IReference;
|
|
use OCP\Collaboration\Reference\IReferenceProvider;
|
|
|
|
class ContentReferenceProvider implements IReferenceProvider {
|
|
private ContentReferenceHelper $referenceHelper;
|
|
private ReferenceManager $referenceManager;
|
|
|
|
public function __construct(ContentReferenceHelper $referenceHelper, ReferenceManager $referenceManager) {
|
|
$this->referenceHelper = $referenceHelper;
|
|
$this->referenceManager = $referenceManager;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function matchReference(string $referenceText): bool {
|
|
return $this->referenceHelper->matchReference($referenceText);
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function resolveReference(string $referenceText): ?IReference {
|
|
return $this->referenceHelper->resolveReference($referenceText);
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function getCachePrefix(string $referenceId): string {
|
|
return $this->referenceHelper->getCachePrefix($referenceId);
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function getCacheKey(string $referenceId): ?string {
|
|
return $this->referenceHelper->getCacheKey($referenceId);
|
|
}
|
|
|
|
/**
|
|
* @param string $userId
|
|
* @return void
|
|
*/
|
|
public function invalidateUserCache(string $userId): void {
|
|
$this->referenceManager->invalidateCache($userId);
|
|
}
|
|
}
|