public function __construct($where = null, $params = array())
{
if (is_object($where)) {
$this->_sql = $where->toSql(false);
} elseif (is_array($where)) {
$conditions = array();
foreach ($where as $key => $val) {
$conditions[] = $this->bind('`' . $key . '`' . '=?', array($val));
}
$this->_sql = implode(' AND ', $conditions);
} elseif (!empty($where)) {
$this->_sql = $this->bind($where, (array) $params);
}
}