function EndOfTransactionQueriesTest::statementToTableName

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php \Drupal\KernelTests\Core\Cache\EndOfTransactionQueriesTest::statementToTableName()

Returns the table name for a statement.

Parameters

string $statement: The query statement.

Return value

string|null The name of the table or NULL if none was found.

File

core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php, line 166

Class

EndOfTransactionQueriesTest
Tests that cache tag invalidation queries are delayed to the end of transactions.

Namespace

Drupal\KernelTests\Core\Cache

Code

protected static function statementToTableName($statement) {
    if (preg_match('/.*\\{([^\\}]+)\\}.*/', $statement, $matches)) {
        return $matches[1];
    }
    else {
        return NULL;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.