本文整理汇总了PHP中Gpf_SqlBuilder_SelectBuilder::getAllRowsIterator方法的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_SqlBuilder_SelectBuilder::getAllRowsIterator方法的具体用法?PHP Gpf_SqlBuilder_SelectBuilder::getAllRowsIterator怎么用?PHP Gpf_SqlBuilder_SelectBuilder::getAllRowsIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gpf_SqlBuilder_SelectBuilder
的用法示例。
在下文中一共展示了Gpf_SqlBuilder_SelectBuilder::getAllRowsIterator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRules
/**
* @param String $campaignId
* @return Gpf_SqlBuilder_SelectIterator
*/
private function getRules($campaignId) {
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->addAll(Pap_Db_Table_Rules::getInstance());
$select->from->add(Pap_Db_Table_Rules::getName());
$select->where->add(Pap_Db_Table_Rules::CAMPAIGN_ID, '=', $campaignId);
return $select->getAllRowsIterator();
}
示例2: getChildren
/**
* @return array
*/
public function getChildren(Pap_Common_User $parent, $offset = '', $limit = '') {
$children = array();
$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
$selectBuilder->select->addAll(Pap_Db_Table_Users::getInstance(), 'pu');
$selectBuilder->select->addAll(Gpf_Db_Table_AuthUsers::getInstance(), 'au');
$selectBuilder->from->add(Pap_Db_Table_Users::getName(), 'pu');
$selectBuilder->from->addInnerJoin(Gpf_Db_Table_Users::getName(), 'gu', 'pu.accountuserid = gu.accountuserid');
$selectBuilder->from->addInnerJoin(Gpf_Db_Table_AuthUsers::getName(), 'au', 'gu.authid = au.authid');
$selectBuilder->where->add(Pap_Db_Table_Users::PARENTUSERID, '=', $parent->getId());
$selectBuilder->where->add(Gpf_Db_Table_Users::STATUS, 'IN', array(Pap_Common_Constants::STATUS_APPROVED, Pap_Common_Constants::STATUS_PENDING));
$selectBuilder->orderBy->add(Pap_Db_Table_Users::DATEINSERTED);
$selectBuilder->limit->set($offset, $limit);
foreach ($selectBuilder->getAllRowsIterator() as $userRecord) {
$user = new Pap_Common_User();
$user->fillFromRecord($userRecord);
$children[] = $user;
}
return $children;
}
示例3: getCoupons
/**
* @param $bannerID
* @return Iterator
*/
protected function getCoupons($bannerID, $userID) {
$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
$selectBuilder->select->addAll(Pap_Db_Table_Coupons::getInstance());
$selectBuilder->from->add(Pap_Db_Table_Coupons::getName());
$selectBuilder->where->add(Pap_Db_Table_Coupons::BANNERID, '=', $bannerID);
$selectBuilder->where->add(Pap_Db_Table_Coupons::USERID, '=', $userID);
$selectBuilder->limit->set(0, 1);
return $selectBuilder->getAllRowsIterator();
}
示例4: deactivateInRebrand
private function deactivateInRebrand() {
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->addAll(Pap_Db_Table_Banners::getInstance());
$select->from->add(Pap_Db_Table_Banners::getName());
$select->where->add(Pap_Db_Table_Banners::TYPE, '=', Pap_Features_RebrandPdfBanner_Config::TYPE);
foreach ($select->getAllRowsIterator() as $rebrandData) {
$this->removeCouponConstants($rebrandData);
}
}
示例5: processAllRows
protected function processAllRows(Gpf_SqlBuilder_SelectBuilder $select) {
$this->isComputed = true;
if (!$select->select->existsAlias(self::ACTIONS_COMMISSIONTYPEID)) {
$select->select->add('s.'.self::ACTIONS_COMMISSIONTYPEID);
$select->groupBy->add('s.'.self::ACTIONS_COMMISSIONTYPEID);
}
foreach ($select->getAllRowsIterator() as $resultRow) {
$this->processRow($resultRow, $resultRow->get(self::ACTIONS_COMMISSIONTYPEID));
}
}
示例6: loadChannels
public function loadChannels() {
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->add(Pap_Db_Table_Channels::VALUE);
$select->select->add(Pap_Db_Table_Channels::NAME);
$select->from->add(Pap_Db_Table_Channels::getName());
$select->where->add(Pap_Db_Table_Channels::USER_ID, '=', Gpf_Session::getAuthUser()->getPapUserId());
$this->channels = array();
foreach ($select->getAllRowsIterator() as $row) {
$this->channels[$row->get(Pap_Db_Table_Channels::VALUE)] = $row->get(Pap_Db_Table_Channels::NAME);
}
}
示例7: getCampaignCategories
private function getCampaignCategories($cmpid) {
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->add(Pap_Db_Table_CampaignsInCategory::CATEGORYID);
$select->from->add(Pap_Db_Table_CampaignsInCategory::getName());
$select->where->add(Pap_Db_Table_CampaignsInCategory::CAMPAIGNID,'=', $cmpid);
$select->groupBy->add(Pap_Db_Table_CampaignsInCategory::CATEGORYID);
$rows = $select->getAllRowsIterator();
$categories = array();
foreach ($rows as $row) {
$categories[] = $row->get(Pap_Db_Table_CampaignsInCategory::CATEGORYID);
}
return $categories;
}
示例8: firstTimeApproved
public function firstTimeApproved(Pap_Affiliates_User $user){
$userInCommision = new Pap_Db_UserInCommissionGroup();
$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
$selectBuilder->select->addAll(Pap_Db_Table_Campaigns::getInstance(), 'ca');
$selectBuilder->from->add('qu_pap_commissiongroups', 'c');
$selectBuilder->from->addInnerJoin('qu_pap_userincommissiongroup', 'u', 'u.commissiongroupid=c.commissiongroupid');
$selectBuilder->from->addInnerJoin(Pap_Db_Table_Campaigns::getName(), 'ca', 'ca.'.Pap_Db_Table_Campaigns::ID.'=c.campaignid');
$selectBuilder->where->add('u.userid','=',$user->getId());
foreach ($selectBuilder->getAllRowsIterator() as $row){
$campaign = new Pap_Common_Campaign();
$campaign->fillFromRecord($row);
$userInCommision->sendInviteMail($campaign,$user->getId());
}
}
示例9: buildData
protected function buildData(Gpf_Data_RecordSet $fields, Gpf_Rpc_Params $params) {
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->add("name", "payoutFieldName", "ff");
$select->select->add(Pap_Db_Table_UserPayoutOptions::VALUE, Pap_Db_Table_UserPayoutOptions::VALUE, "upo");
$select->select->add(Pap_Db_Table_UserPayoutOptions::FORMFIELDID, Pap_Db_Table_UserPayoutOptions::FORMFIELDID, "upo");
$select->from->add(Pap_Db_Table_Users::getName(), "pu");
$select->from->addInnerJoin(Gpf_Db_Table_FormFields::getName(), "ff", "(ff.formid = CONCAT('payout_option_', pu.payoutoptionid))");
$select->from->addInnerJoin(Pap_Db_Table_UserPayoutOptions::getName(), "upo", "(pu.userid = upo.userid AND ff.formfieldid = upo.formfieldid)");
$select->where->add("pu.userid", "=", $params->get('userid'));
$i = 1;
foreach ($select->getAllRowsIterator() as $payoutField) {
$fields->add(array($payoutField->get(Pap_Db_Table_UserPayoutOptions::FORMFIELDID),
'data' . $i,
$this->_($payoutField->get('payoutFieldName')), 'T', 'M', null, ''));
$this->fieldValues['data' . $i++] = $payoutField->get(Pap_Db_Table_UserPayoutOptions::VALUE);
}
}
示例10: getValues
/**
* @return array<Pap_Db_UserPayoutOption>
*/
public function getValues($formName, $userId) {
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->add('ff.'.Gpf_Db_Table_FormFields::ID, Gpf_Db_Table_FormFields::ID);
$select->select->add('ff.'.Gpf_Db_Table_FormFields::CODE, Gpf_Db_Table_FormFields::CODE);
$select->select->add('upo.'.self::VALUE, self::VALUE);
$select->select->add('upo.'.self::USERID, self::USERID);
$select->from->add(Gpf_Db_Table_FormFields::getName(), 'ff');
$select->from->addInnerJoin(self::getName(), 'upo', 'upo.formfieldid=ff.formfieldid');
$select->where->add('upo.'.self::USERID, '=', $userId);
$select->where->add('ff.'.Gpf_Db_Table_FormFields::FORMID, '=', $formName);
$values = array();
foreach ($select->getAllRowsIterator() as $row) {
$payoutOption = new Pap_Db_UserPayoutOption();
$payoutOption->fillFromRecord($row);
$values[$row->get('code')] = $payoutOption;
}
return $values;
}
示例11: execute
protected function execute() {
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->addAll(Pap_Db_Table_RecurringCommissions::getInstance());
$select->from->add(Pap_Db_Table_RecurringCommissions::getName());
foreach ($select->getAllRowsIterator() as $row) {
$recurringCommission = new Pap_Features_RecurringCommissions_RecurringCommission();
$recurringCommission->fillFromRecord($row);
$recurringCommission->setPersistent(true);
if ($this->isDone($recurringCommission->getId())) {
continue;
}
$recurrencePreset = $recurringCommission->getRecurrencePreset();
$lastCommissionDate = $recurringCommission->getLastCommissionDate();
if ($lastCommissionDate == null) {
$lastCommissionDate = $recurringCommission->getTransaction()->getDateInserted();
}
$nextTimestamp = $recurrencePreset->getNextDate(Gpf_Common_DateUtils::mysqlDateTime2Timestamp($lastCommissionDate));
if ($nextTimestamp == null || $nextTimestamp > time()) {
continue;
}
$recurringCommission->setLastCommissionDate(Gpf_Common_DateUtils::getDateTime($nextTimestamp));
if ($recurringCommission->getStatus() == Pap_Common_Constants::STATUS_APPROVED) {
try {
$recurringCommission->createCommissions();
} catch (Gpf_Exception $e) {
Gpf_Log::critical('Recurring commissions - error create commissions: ' . $e->getMessage());
$this->setDone();
}
}
$recurringCommission->save();
$this->setDone();
}
}
示例12: sendNotificationEmail
/**
*
* @param $params
*/
protected function sendNotificationEmail(array $linkIds, $deleted = false) {
$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
$selectBuilder->select->addAll(Pap_Db_Table_DirectLinkUrls::getInstance());
$selectBuilder->from->add(Pap_Db_Table_DirectLinkUrls::getName());
$selectBuilder->where->add(Pap_Db_Table_DirectLinkUrls::ID, 'IN', $linkIds);
$usersMailTemplates = $this->getLinks($selectBuilder->getAllRowsIterator(), $deleted);
foreach ($usersMailTemplates as $userId => $mail) {
try {
$user = $this->loadUser($userId);
} catch (Gpf_DbEngine_NoRowException $e) {
Gpf_Log::warning($this->_('Error load affiliate with userid=' . $userId . ', mail will not be send.'));
continue;
}
$attribute = $this->loadAttributes($user->getAccountUserId());
if (Gpf_Settings::get(Pap_Settings::AFF_NOTIFICATION_ON_DIRECT_LINK_ENABLED) == Gpf::YES) {
$isNotify = $attribute->getAttributeWithDefaultValue(Pap_Settings::AFF_NOTIFICATION_ON_DIRECT_LINK_ENABLED,
Gpf_Settings::get(Pap_Settings::AFF_NOTIFICATION_ON_DIRECT_LINK_DEFAULT));
} else {
$isNotify = Gpf_Settings::get(Pap_Settings::AFF_NOTIFICATION_ON_DIRECT_LINK_DEFAULT);
}
if ($isNotify == Gpf::YES) {
$mail->setUser($user);
$mail->addRecipient($user->getEmail());
try {
$mail->send();
} catch (Exception $e) {
Gpf_Log::error($this->_('Error sending direct link changed status notification email to affiliate: %s', $e->getMessage()));
}
}
}
}
示例13: chooseSomeCampaignAsDefault
private function chooseSomeCampaignAsDefault() {
$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
$selectBuilder->select->add('*');
$selectBuilder->from->add('qu_pap_campaigns', 'c');
foreach($selectBuilder->getAllRowsIterator() as $record) {
if($record->get('rtype') == Pap_Db_Campaign::CAMPAIGN_TYPE_PUBLIC
&& $record->get('rstatus') == Pap_Db_Campaign::CAMPAIGN_STATUS_ACTIVE)
{
return $record->get('campaignid');
}
}
// no active and public campaign found
foreach($selectBuilder->getAllRowsIterator() as $record) {
if($record->get('rstatus') == Pap_Db_Campaign::CAMPAIGN_STATUS_ACTIVE) {
return $record->get('campaignid');
}
}
// no active campaign found
return '';
}
示例14: migrateUsersInCampaigns
protected function migrateUsersInCampaigns() {
Pap3Compatibility_Migration_OutputWriter::log(" Migrating users in campaigns.....");
$selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
$selectBuilder->select->add('*');
$selectBuilder->from->add('wd_pa_affiliatescampaigns');
$count = 0;
foreach($selectBuilder->getAllRowsIterator() as $record) {
if($record->get('affiliateid') == '' || $record->get('campcategoryid') == '') {
continue;
}
$count++;
try {
$obj = new Pap_Db_UserInCommissionGroup();
$obj->setUserId($record->get('affiliateid'));
$obj->setCommissionGroupId($record->get('campcategoryid'));
$obj->setStatus(Pap3Compatibility_Migration_Pap3Constants::translateStatus($record->get('rstatus')));
$obj->setDateAdded(Gpf_Common_DateUtils::now());
$obj->save();
} catch(Gpf_Exception $e) {
// non important error, don't display it
}
}
Pap3Compatibility_Migration_OutputWriter::log(" ($count) ..... DONE<br/>");
}
示例15: getImpressions
/**
* @param $selectBuilder
* @return Gpf_SqlBuilder_SelectIterator
*/
protected function getImpressions(Gpf_SqlBuilder_SelectBuilder $selectBuilder)
{
return $selectBuilder->getAllRowsIterator();
}