From 78d33182a01bb4da4d3d8afc6fcaa1b29fcd44c7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 12 Aug 2026 12:07:33 +0200 Subject: [PATCH] feat(dbal): Add ITable::getIndex Signed-off-by: Carl Schwan --- lib/private/DB/Schema/Table.php | 5 +++++ lib/public/DB/Schema/ITable.php | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/private/DB/Schema/Table.php b/lib/private/DB/Schema/Table.php index 7f3e6db8015..d8b99cfa5ce 100644 --- a/lib/private/DB/Schema/Table.php +++ b/lib/private/DB/Schema/Table.php @@ -256,6 +256,11 @@ class Table implements ITable { )); } + #[\Override] + public function getIndex(string $name): IIndex { + return new Index($this->table->getIndex($name)); + } + #[\Override] public function getForeignKeys(): array { return array_values(array_map( diff --git a/lib/public/DB/Schema/ITable.php b/lib/public/DB/Schema/ITable.php index e6cde299f81..35311b02690 100644 --- a/lib/public/DB/Schema/ITable.php +++ b/lib/public/DB/Schema/ITable.php @@ -201,6 +201,15 @@ interface ITable { */ public function getIndexes(): array; + /** + * Returns a specific index by name of this table. + * + * @param non-empty-string $name The index name. + * @return IIndex + * @since 35.0.0 + */ + public function getIndex(string $name): IIndex; + /** * Adds a foreign key constraint. *