Config.php 519 B

123456789101112131415161718192021
  1. <?php
  2. namespace Entity;
  3. class Config extends ModelBase
  4. {
  5. protected function install()
  6. {
  7. $dbPrefix = $this->getDbPrefix();
  8. $result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}config` (
  9. `lang` VARCHAR(8) NULL,
  10. `key` VARCHAR(64) NOT NULL,
  11. `value` TEXT NULL,
  12. UNIQUE(`lang`, `key`)
  13. )");
  14. if ($result === false)
  15. throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
  16. return true;
  17. }
  18. }