Beispiel #1
0
 public function setType(Type $type)
 {
     switch ($type) {
         case Type::VIEW():
             $this->setEngine(Engine::VIEW());
             break;
         case Type::TABLE():
             if ($this->getEngine() === Engine::VIEW()) {
                 $this->setEngine(Engine::INNODB());
             }
             break;
     }
 }
 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;
 }