Subversion Repositories PHPX

Rev

Rev 29 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
27 PointedEar 1
<?php
2
 
3
require_once 'lib/Db/Database.php';
4
 
5
class ODBCDB extends Database
6
{
7
  /**
8
   * ODBC alias
9
   * @var string
10
   */
11
  protected $_alias;
12
 
13
  public function __construct()
14
  {
15
    $this->_connection = @odbc_connect($this->_alias, "" ,"");
16
  }
17
 
18
  /**
19
   * Escapes a database name so that it can be used in a query.
20
   *
21
   * @param string $name
22
   *   The name to be escaped
23
   * @return string
24
   *   The escaped name
25
   */
26
  public function escapeName($name)
27
  {
28
    return '[' . $name . ']';
29
  }
30
 
31
  /**
32
   * (non-PHPdoc)
33
   * @see Database::_escapeAliasArray()
34
   */
35
  protected function _escapeAliasArray(array &$array)
36
  {
37
    foreach ($array as $column => &$value)
38
    {
39
      $value = $value . ' AS [' . $column . ']';
40
    }
41
 
42
    return $array;
43
  }
44
 
45
  /**
46
   * (non-PHPdoc)
47
   * @see Database::_escapeValueArray()
48
   */
49
  protected function _escapeValueArray(array &$array, $suffix = '', array &$escape = array('`', '`'))
50
  {
51
    return parent::_escapeValueArray($array, $suffix, $escape);
52
  }
53
}