Skip to content

Commit 78d3318

Browse files
committed
feat(dbal): Add ITable::getIndex
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 7bf0887 commit 78d3318

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

lib/private/DB/Schema/Table.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ public function getIndexes(): array {
256256
));
257257
}
258258

259+
#[\Override]
260+
public function getIndex(string $name): IIndex {
261+
return new Index($this->table->getIndex($name));
262+
}
263+
259264
#[\Override]
260265
public function getForeignKeys(): array {
261266
return array_values(array_map(

lib/public/DB/Schema/ITable.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ public function getColumns(): array;
201201
*/
202202
public function getIndexes(): array;
203203

204+
/**
205+
* Returns a specific index by name of this table.
206+
*
207+
* @param non-empty-string $name The index name.
208+
* @return IIndex
209+
* @since 35.0.0
210+
*/
211+
public function getIndex(string $name): IIndex;
212+
204213
/**
205214
* Adds a foreign key constraint.
206215
*

0 commit comments

Comments
 (0)