HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/web/matomo.vdk/core/Db/TransactionalDatabaseDynamicTrait.php
<?php

namespace Piwik\Db;

trait TransactionalDatabaseDynamicTrait
{
    private $supportsTransactionLevelForNonLockingReads;

    public function getCurrentTransactionIsolationLevelForSession(): string
    {
        try {
            return $this->fetchOne('SELECT @@TX_ISOLATION');
        } catch (\Exception $e) {
            return $this->fetchOne('SELECT @@transaction_isolation');
        }
    }

    public function setTransactionIsolationLevel(string $level): void
    {
        $this->query("SET SESSION TRANSACTION ISOLATION LEVEL $level");
    }

    public function getSupportsTransactionLevelForNonLockingReads(): ?bool
    {
        return $this->supportsTransactionLevelForNonLockingReads;
    }

    public function setSupportsTransactionLevelForNonLockingReads(?bool $supports = null): void
    {
        $this->supportsTransactionLevelForNonLockingReads = $supports;
    }
}