function __construct() { if (!isset(self::$PDO)) { $dsn = \woo\base\ApplicationRegistry::getDSN(); if (is_null($dsn)) { throw new \woo\base\AppException("No DSN"); } self::$PDO = new \PDO($dsn); self::$PDO->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); } }
function __construct() { if (!isset(self::$PDO)) { $dsn = ApplicationRegistry::getDSN(); if (is_null($dsn)) { throw new AppException('DSN не определен'); } self::$PDO = new \PDO($dsn); self::$PDO->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); } }