Skip to content

Remove getCacheKey() and getCacheTag() from Schema #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- Chg #310: Remove usage of `hasLimit()` and `hasOffset()` methods of `DQLQueryBuilder` class (@Tigrov)
- Enh #313: Refactor according changes in `db` package (@Tigrov)
- New #311: Add `caseSensitive` option to like condition (@vjik)
- Enh #315: Remove `getCacheKey()` and `getCacheTag()` methods from `Schema` class (@Tigrov)

## 1.3.0 March 21, 2024

Expand Down
26 changes: 0 additions & 26 deletions src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
use function array_reverse;
use function implode;
use function is_array;
use function md5;
use function preg_replace;
use function serialize;
use function strtolower;

/**
Expand Down Expand Up @@ -739,28 +737,4 @@ protected function findViewNames(string $schema = ''): array

return $views;
}

/**
* Returns the cache key for the specified table name.
*
* @param string $name The table name.
*
* @return array The cache key.
*/
protected function getCacheKey(string $name): array
{
return [self::class, ...$this->generateCacheKey(), $this->db->getQuoter()->getRawTableName($name)];
}

/**
* Returns the cache tag name.
*
* This allows {@see refresh()} to invalidate all cached table schemas.
*
* @return string The cache tag name.
*/
protected function getCacheTag(): string
{
return md5(serialize([self::class, ...$this->generateCacheKey()]));
}
}