本文整理汇总了PHP中Kwf_Model_Select::merge方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwf_Model_Select::merge方法的具体用法?PHP Kwf_Model_Select::merge怎么用?PHP Kwf_Model_Select::merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwf_Model_Select
的用法示例。
在下文中一共展示了Kwf_Model_Select::merge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _convertSelect
private function _convertSelect($select, $modelKey, $m)
{
$s = new Kwf_Model_Select();
if ($p = $select->getPart(Kwf_Model_Select::WHERE_ID)) {
if (substr($p, 0, strlen($modelKey)) == $modelKey) {
$s->whereId(substr($p, strlen($modelKey)));
} else {
return null;
}
}
if ($p = $select->getPart(Kwf_Model_Select::WHERE_EQUALS)) {
foreach ($p as $f => $v) {
if ($f == 'id') {
if (is_array($v)) {
$filterV = array();
foreach ($v as $i) {
if (substr($i, 0, strlen($modelKey)) == $modelKey) {
$filterV[] = substr($i, strlen($modelKey));
}
}
if (!$filterV) {
return null;
}
$v = $filterV;
} else {
if (substr($v, 0, strlen($modelKey)) == $modelKey) {
$v = substr($v, strlen($modelKey));
} else {
return null;
}
}
}
if (in_array($f, $this->_getOwnColumns())) {
$f = $this->_mapColumn($m, $f);
$s->whereEquals($f, $v);
}
}
}
if ($p = $select->getPart(Kwf_Model_Select::WHERE_NOT_EQUALS)) {
foreach ($p as $f => $v) {
if ($f == 'id') {
if (substr($v, 0, strlen($modelKey)) != $modelKey) {
continue;
} else {
$v = substr($v, strlen($modelKey));
}
}
if (in_array($f, $this->_getOwnColumns())) {
$f = $this->_mapColumn($m, $f);
$s->whereNotEquals($f, $v);
}
}
}
if ($p = $select->getPart(Kwf_Model_Select::WHERE_NULL)) {
foreach ($p as $f) {
if (in_array($f, $this->_getOwnColumns())) {
$f = $this->_mapColumn($m, $f);
$s->whereNull($f);
}
}
}
if ($p = $select->getPart(Kwf_Model_Select::WHERE_EXPRESSION)) {
foreach ($p as $expr) {
$e = $this->_convertExpr($expr, $modelKey, $m);
if ($e) {
$s->where($e);
}
}
}
if ($p = $select->getPart(Kwf_Model_Select::IGNORE_DELETED)) {
$s->ignoreDeleted($p);
}
if (isset($this->_mergeSelects[$modelKey])) {
$s->merge($this->_mergeSelects[$modelKey]);
}
return $s;
}