/** * @return \PDO */ public static function getConnection() { if (!isset(self::$connection)) { $dsn = "mysql:host=" . self::$config['host'] . ';dbname=' . self::$config['dbname']; self::$connection = new \PDO($dsn, self::$config['user'], self::$config['pass']); } return self::$connection; }