original_string: public static function getConnection($dsn)
      {
          if (!is_array($dsn)) {
              $dsn = self::parseDsn($dsn);
          }
          if (!isset($dsn['adapter'])) {
              throw new Exception("database adapter is missing for " . json_encode($dsn));
          }
          $class = 'Phalcon\Db\Adapter\Pdo\\' . ucfirst($dsn['adapter']);
          $conn = new $class($dsn);
          return Mixin::create($conn, new self);
      }
code: public static function getConnection($dsn)
      {
          if (!is_array($dsn)) {
              $dsn = self::parseDsn($dsn);
          }
          if (!isset($dsn['adapter'])) {
              throw new Exception("database adapter is missing for " . json_encode($dsn));
          }
          $class = 'Phalcon\Db\Adapter\Pdo\\' . ucfirst($dsn['adapter']);
          $conn = new $class($dsn);
          return Mixin::create($conn, new self);
      }
code_tokens: public static function getConnection ( $ dsn ) { if ( ! is_array ( $ dsn ) ) { $ dsn = self :: parseDsn ( $ dsn ) ; } if ( ! isset ( $ dsn [ 'adapter' ] ) ) { throw new Exception ( "database adapter is missing for " . json_encode ( $ dsn ) ) ; } $ class = 'Phalcon\Db\Adapter\Pdo\\' . ucfirst ( $ dsn [ 'adapter' ] ) ; $ conn = new $ class ( $ dsn ) ; return Mixin :: create ( $ conn , new self ) ; }
docstring: creates database connect by dsn
  
  @param string $dsn
  @return DbAdapter
docstring_tokens: creates database connect by dsn