preferenceService = $preferenceService; } /** * @brief return preference for $fileId * * @NoAdminRequired * @NoCSRFRequired * * @param string $scope * @param int $fileId * @param ?string $name if null, return all preferences for $scope + $fileId */ public function get(string $scope, int $fileId, ?string $name = null): JSONResponse { return new JSONResponse($this->preferenceService->get($scope, $fileId, $name)); } /** * @brief write preference for $fileId * * @NoAdminRequired * @NoCSRFRequired * * @param string $scope * @param int $fileId * @param string $name * @param string $value * * @return array|\OCP\AppFramework\Http\JSONResponse */ public function set(string $scope, int $fileId, string $name, string $value) { return new JSONResponse($this->preferenceService->set($scope, $fileId, $name, $value)); } /** * @brief return default preference * * @NoAdminRequired * @NoCSRFRequired * * @param string $scope * @param string $name if null, return all default preferences for scope */ public function getDefault(string $scope, string $name): JSONResponse { return new JSONResponse($this->preferenceService->getDefault($scope, $name)); } /** * @brief write default preference * * @NoAdminRequired * @NoCSRFRequired * * @param string $scope * @param string $name * @param string $value */ public function setDefault(string $scope, string $name, string $value): JSONResponse { return new JSONResponse($this->preferenceService->setDefault($scope, $name, $value)); } /** * @brief delete preference * * @param string $scope * @param int $fileId * @param string $name */ public function delete(string $scope, int $fileId, string $name): void { $this->preferenceService->delete($scope, $fileId, $name); } /** * @brief delete default preference * * @param string $scope * @param string $name */ public function deleteDefault(string $scope, string $name): void { $this->preferenceService->deleteDefault($scope, $name); } }