getConnection()->getQueryLog(); } static function beginTransaction() { return self::$db->getConnection()->getPdo()->beginTransaction(); } static function getDB() { return self::$db; } static function rollBack() { return self::$db->getConnection()->getPdo()->rollBack(); } static function commit() { return self::$db->getConnection()->getPdo()->commit(); } public static function init() { $conf = GlobConfigs::getKey('pgsql'); self::$db = new DB(); self::$db->addConnection($conf); self::$db->setAsGlobal(); self::$db->bootEloquent(); return self::$db; } public static function close() { if (self::$db) { self::$db->getConnection()->disconnect(); self::$db = null; } } }