fix getTableNamesWithoutPrefix()
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
This commit is contained in:
parent
333665b43d
commit
52080c92e5
|
@ -59,15 +59,14 @@ class SchemaWrapper implements ISchemaWrapper {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTableNamesWithoutPrefix() {
|
||||
$tableNames = $this->schema->getTableNames();
|
||||
public function getTableNamesWithoutPrefix(): array {
|
||||
return array_map(function ($tableName) {
|
||||
if (strpos($tableName, $this->connection->getPrefix()) === 0) {
|
||||
return substr($tableName, strlen($this->connection->getPrefix()));
|
||||
}
|
||||
|
||||
return $tableName;
|
||||
}, $tableNames);
|
||||
}, $this->getTableNames());
|
||||
}
|
||||
|
||||
// Overwritten methods
|
||||
|
@ -75,8 +74,15 @@ class SchemaWrapper implements ISchemaWrapper {
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getTableNames() {
|
||||
return $this->schema->getTableNames();
|
||||
public function getTableNames(): array {
|
||||
return array_map(function (string $fullName) {
|
||||
$pos = strpos($fullName, '.');
|
||||
if ($pos === false) {
|
||||
return $fullName;
|
||||
}
|
||||
|
||||
return substr($fullName, $pos+1);
|
||||
}, $this->schema->getTableNames());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue