Files
OMS/app/dbeav/lib/select/adapter.php
2025-12-28 23:13:25 +08:00

62 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
abstract class dbeav_select_adapter
{
protected $_connect = null;
abstract public function connect();
abstract public function limit($sql, $count, $offset=0);
abstract public function quote_column_as($column, $alias);
abstract public function quote_identifier($name);
abstract public function fetch($fetchMode=null);
abstract public function fetch_all();
abstract public function fetch_row();
abstract public function fetch_one();
abstract public function fetch_col();
function __contruct()
{
}//End Function
/**
* query
* @param mixed $selectObj selectObj
* @return mixed 返回值
*/
public function query($selectObj){
$sql = $selectObj->assemble();
$res = $this->_connect->query($sql);
return $res;
}
/**
* quote
* @param mixed $name name
* @return mixed 返回值
*/
public function quote($name)
{
if (is_int($value)) {
return $value;
} elseif (is_float($value)) {
return sprintf('%F', $value);
}
return "'" . addcslashes($value, "\000\n\r\\'\"\032") . "'";
}//End Function
}//End Class