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; } }