本文整理汇总了PHP中Zend_Db_Select::setIntegrityCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Select::setIntegrityCheck方法的具体用法?PHP Zend_Db_Select::setIntegrityCheck怎么用?PHP Zend_Db_Select::setIntegrityCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Db_Select
的用法示例。
在下文中一共展示了Zend_Db_Select::setIntegrityCheck方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _applySelect
protected function _applySelect(Zend_Db_Select $dbSelect, Kwf_Model_Select $select)
{
if ($dbSelect instanceof Zend_Db_Table_Select) {
$dbSelect->setIntegrityCheck(false);
}
if ($whereEquals = $select->getPart(Kwf_Model_Select::WHERE_EQUALS)) {
foreach ($whereEquals as $field => $value) {
if (is_array($value)) {
if ($value) {
foreach ($value as &$v) {
if (!is_int($v)) {
$v = $this->_fixStupidQuoteBug($v);
$v = $this->getAdapter()->quote($v);
}
}
$value = implode(', ', $value);
$dbSelect->where($this->_formatField($field, $dbSelect) . " IN ({$value})");
} else {
$dbSelect->where('0');
}
} else {
$value = $this->_fixStupidQuoteBug($value);
$dbSelect->where($this->_formatField($field, $dbSelect) . " = ?", $value);
}
}
}
if ($whereNotEquals = $select->getPart(Kwf_Model_Select::WHERE_NOT_EQUALS)) {
foreach ($whereNotEquals as $field => $value) {
if (is_array($value)) {
foreach ($value as &$v) {
if (!is_int($v)) {
$v = $this->_fixStupidQuoteBug($v);
$v = $this->getAdapter()->quote($v);
}
}
$value = implode(', ', $value);
$dbSelect->where($this->_formatField($field, $dbSelect) . " NOT IN ({$value})");
} else {
$value = $this->_fixStupidQuoteBug($value);
$dbSelect->where($this->_formatField($field, $dbSelect) . " != ?", $value);
}
}
}
if ($this->_hasDeletedFlag && !$select->getPart(Kwf_Model_Select::IGNORE_DELETED)) {
$dbSelect->where("deleted = 0");
}
if ($where = $select->getPart(Kwf_Model_Select::WHERE)) {
foreach ($where as $w) {
$dbSelect->where($w[0], $w[1], $w[2]);
}
}
if ($whereId = $select->getPart(Kwf_Model_Select::WHERE_ID)) {
$whereId = $this->_fixStupidQuoteBug($whereId);
$dbSelect->where($this->_formatField($this->getPrimaryKey(), $dbSelect) . " = ?", $whereId);
}
if ($whereNull = $select->getPart(Kwf_Model_Select::WHERE_NULL)) {
foreach ($whereNull as $field) {
$dbSelect->where("ISNULL(" . $this->_formatField($field, $dbSelect) . ")");
}
}
if ($other = $select->getPart(Kwf_Model_Select::OTHER)) {
foreach ($other as $i) {
call_user_func_array(array($dbSelect, $i['method']), $i['arguments']);
}
}
if ($whereExpression = $select->getPart(Kwf_Model_Select::WHERE_EXPRESSION)) {
foreach ($whereExpression as $expr) {
$expr->validate();
$dbSelect->where($this->_createDbSelectExpression($expr, $dbSelect));
}
}
if ($exprs = $select->getPart(Kwf_Model_Select::EXPR)) {
foreach ($exprs as $field) {
if (!($col = $this->_formatField($field, $dbSelect))) {
throw new Kwf_Exception("Expression '{$field}' not found");
}
$dbSelect->from(null, array($field => new Zend_Db_Expr($col)));
}
}
}