public function getTablePage($tableId) { if (is_numeric($tableId)) { $tableId = array_keys($this->columnsMap)[$tableId]; } $entity = new DatabaseSchemaPage(); $entity->setName($tableId); $entity->setCollation("latin1_bin"); $entity->setEngine(Engine::INFORMATION_SCHEMA()); $entity->setType(Type::TABLE()); return $entity; }
public function getTableManager() { if (is_null($this->tableManager)) { $this->tableManager = new TableManager($this->getFilesystem(), $this->getSchemaManager()); $columnDataFactory = new ColumnDataFactory($this->getFilesystem()); $tableFactory = new TableFactory($this->getFilesystem(), $columnDataFactory); foreach ([Engine::MARIADB(), Engine::MYISAM(), Engine::INNODB()] as $engine) { $this->tableManager->registerFactory($engine, $tableFactory); } $this->tableManager->registerFactory(Engine::INFORMATION_SCHEMA(), new InformationSchemaTableFactory($this->schemaManager)); # TODO: add factories for all the other table-engines out there } return $this->tableManager; }