本文整理汇总了PHP中ResultSet::copyColumData方法的典型用法代码示例。如果您正苦于以下问题:PHP ResultSet::copyColumData方法的具体用法?PHP ResultSet::copyColumData怎么用?PHP ResultSet::copyColumData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResultSet
的用法示例。
在下文中一共展示了ResultSet::copyColumData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copy
function copy()
{
$newResultSet = new ResultSet();
$newResultSet->copyColumData($this);
$this->reset();
$newResultSet->reset();
while ($this->next()) {
$newResultSet->appendRow($this->rows[$this->pos]->fields, $this->rows[$this->pos]->id);
}
return $newResultSet;
}
示例2: filterRowsByAndConditions
function filterRowsByAndConditions($params1, $params2, $operators)
{
$rs = new ResultSet();
$rs->copyColumData($this);
$this->reset();
$colNrs1 = array();
$colNrs2 = array();
// find column nr's for params1 -1=no column, its a direct value
for ($i = 0; $i < count($params1); ++$i) {
if (($colNrs1[$i] = $this->findColNrByFullName($params1[$i])) == NOT_FOUND) {
if (has_quotes($params1[$i]) || is_numeric($params1[$i])) {
$colNrs1[$i] = -1;
if (has_quotes($params1[$i])) {
remove_quotes($params1[$i]);
}
} else {
print_error_msg("Column '" . $params1[$i] . "' not found");
return null;
}
}
}
// find column nr's for params2 -1=no column, its a direct value
for ($i = 0; $i < count($params2); ++$i) {
if (($colNrs2[$i] = $this->findColNrByFullName($params2[$i])) == NOT_FOUND) {
if (has_quotes($params2[$i]) || is_numeric($params2[$i])) {
$colNrs2[$i] = -1;
if (has_quotes($params2[$i])) {
remove_quotes($params2[$i]);
}
} else {
print_error_msg("Column '" . $params2[$i] . "' not found");
return null;
}
}
}
$val1 = "";
$val2 = "";
$this->reset();
while (++$this->pos < count($this->rows)) {
$recMetsConds = true;
for ($i = 0; $i < count($params1); ++$i) {
if ($colNrs1[$i] == -1) {
$val1 = $params1[$i];
} else {
$val1 = $this->rows[$this->pos]->fields[$colNrs1[$i]];
}
if ($colNrs2[$i] == -1) {
$val2 = $params2[$i];
} else {
$val2 = $this->rows[$this->pos]->fields[$colNrs2[$i]];
}
if (!compare($val1, $val2, $operators[$i])) {
$recMetsConds = false;
break;
}
}
if ($recMetsConds) {
$rs->append(false);
$rs->rows[$rs->pos]->fields = $this->rows[$this->pos]->fields;
$rs->rows[$rs->pos]->id = $this->rows[$this->pos]->id;
}
}
// reset ResultSet's
$this->reset();
$rs->reset();
return $rs;
}