mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
fix(db): Doctrine\DBAL\Schema\Schema::getTableNames() was removed
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
165443046a
commit
4c1003122d
1 changed files with 8 additions and 8 deletions
|
|
@ -8,6 +8,7 @@ namespace OC\DB;
|
|||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\DBAL\Schema\Table;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
|
||||
class SchemaWrapper implements ISchemaWrapper {
|
||||
|
|
@ -43,26 +44,25 @@ class SchemaWrapper implements ISchemaWrapper {
|
|||
/**
|
||||
* Gets all table names
|
||||
*
|
||||
* @return array
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getTableNamesWithoutPrefix() {
|
||||
$tableNames = $this->schema->getTableNames();
|
||||
return array_map(function ($tableName) {
|
||||
public function getTableNamesWithoutPrefix(): array {
|
||||
return array_map(function (string $tableName) {
|
||||
if (str_starts_with($tableName, $this->connection->getPrefix())) {
|
||||
return substr($tableName, strlen($this->connection->getPrefix()));
|
||||
}
|
||||
|
||||
return $tableName;
|
||||
}, $tableNames);
|
||||
}, $this->getTableNames());
|
||||
}
|
||||
|
||||
// Overwritten methods
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getTableNames() {
|
||||
return $this->schema->getTableNames();
|
||||
public function getTableNames(): array {
|
||||
return array_map(static fn (Table $table) => $table->getName(), $this->schema->getTables());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue