21,8 → 21,6 |
*/ |
class Database extends AbstractModel |
{ |
/* Access properties */ |
|
/** |
* DSN of the database |
* @var string |
46,26 → 44,8 |
* @var array |
*/ |
protected $_options = array(); |
|
/** |
* Database-specific string to use for quoting a name or value |
* left-hand side (for security reasons and to prevent a name |
* from being parsed as a keyword). |
* @var string |
*/ |
protected $_leftQuote = ''; |
|
/** |
* Database-specific string to use for quoting a name or value |
* left-hand side (for security reasons and to prevent a name |
* from being parsed as a keyword). |
* @var string |
*/ |
protected $_rightQuote = ''; |
|
/* Status properties */ |
|
/** |
* Database connection |
* @var PDO |
*/ |
165,7 → 145,7 |
*/ |
public function escapeName($name) |
{ |
return $this->_leftQuote . $name . $this->_rightQuote; |
return $name; |
} |
|
/** |
203,14 → 183,7 |
{ |
foreach ($array as $column => &$value) |
{ |
$quotedColumn = $column; |
if (strpos($column, $this->_leftQuote) === false |
&& strpos($column, $this->_rightQuote) === false) |
{ |
$quotedColumn = $this->_leftQuote . $column . $this->_rightQuote; |
} |
|
$value = $value . ' AS ' . $quotedColumn; |
$value = $value . ' AS ' . $column; |
} |
|
return $array; |
255,7 → 228,7 |
* @return array |
* The escaped array |
*/ |
protected function _escapeValueArray(array &$array, $suffix = '') |
protected function _escapeValueArray(array &$array, $suffix = '', array &$escape = array('', '')) |
{ |
$result = array(); |
|
277,7 → 250,7 |
$placeholder = '(' . implode(',', self::_expand($value, $column)) . ')'; |
} |
|
$result[] = $this->_leftQuote . $column . $this->_rightQuote . "{$op}{$placeholder}{$suffix}"; |
$result[] = $escape[0] . $column . $escape[1] . "{$op}{$placeholder}{$suffix}"; |
} |
|
return $result; |