本文整理汇总了PHP中Gpf_Data_RecordSet::toShalowRecordSet方法的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_Data_RecordSet::toShalowRecordSet方法的具体用法?PHP Gpf_Data_RecordSet::toShalowRecordSet怎么用?PHP Gpf_Data_RecordSet::toShalowRecordSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gpf_Data_RecordSet
的用法示例。
在下文中一共展示了Gpf_Data_RecordSet::toShalowRecordSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterExecute
protected function afterExecute(Gpf_Data_RecordSet $inputResult) {
$inputResult->addColumn(Pap_Db_Table_Payouts::AMOUNT);
$inputResult->addColumn('users');
$payoutHistoryIds = array();
foreach ($inputResult as $record) {
$payoutHistoryIds[] = $record->get('id');
}
$outputResult = $inputResult->toShalowRecordSet();
$payeeData = $this->getPayeeData($payoutHistoryIds);
foreach ($inputResult as $record) {
$payoutHistoryId = $record->get('id');
if(!isset($payeeData[$payoutHistoryId])) {
$record->set(Pap_Db_Table_Payouts::AMOUNT, 0);
$record->set("users", "");
} else {
if (!$this->matchesSearchCriteria($record, $payeeData[$payoutHistoryId])) {
$this->_count--;
continue;
}
$record->set("amount", $payeeData[$payoutHistoryId]['amount']);
$record->set("users", $payeeData[$payoutHistoryId]['usersCount'].' '.
($payeeData[$payoutHistoryId]['usersCount'] > 1 ? $this->_("payees") : $this->_("payee")));
}
$outputResult->addRecord($record);
}
return $outputResult;
}
示例2: getBanners
public function getBanners(Gpf_Data_RecordSet $recordSet) {
$result = $recordSet->toShalowRecordSet();
foreach ($recordSet as $record) {
try {
try {
Pap_Db_Table_UserInCommissionGroup::getStatus($record->get('campaignid'), Gpf_Session::getAuthUser()->getPapUserId());
} catch (Gpf_DbEngine_NoRowException $e) {
if ($record->get('ctype') == Pap_Db_Campaign::CAMPAIGN_TYPE_ON_INVITATION) {
throw new Gpf_Exception($this->_('Private campaign'));
}
}
$result->addRecord($record);
} catch (Gpf_Exception $e) {
}
}
$recordSet->clear();
$recordSet->loadFromObject($result->toObject());
}
示例3: getCachedRecordSet
private function getCachedRecordSet(Gpf_Data_RecordSet $recordSet) {
$from = $this->params->get(Gpf_Ui_RichListBox::FROM);
$rowsPerPage = $this->params->get(Gpf_Ui_RichListBox::ROWS_PER_PAGE);
$this->count = $recordSet->getSize();
if ($this->count > $this->params->get(Gpf_Ui_RichListBox::MAX_CACHED_COUNT)) {
$cachedRecordSet = $recordSet->toShalowRecordSet();
if ($from + $rowsPerPage > $this->count) {
$to = $this->count;
} else {
$to = $from + $rowsPerPage;
}
for ($from; $from < $to; $from++) {
$cachedRecordSet->add($recordSet->getRecord($from));
}
return $cachedRecordSet;
}
return $recordSet;
}