当前位置: 首页>>代码示例>>PHP>>正文


PHP Gpf_Data_RecordSet::getSize方法代码示例

本文整理汇总了PHP中Gpf_Data_RecordSet::getSize方法的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_Data_RecordSet::getSize方法的具体用法?PHP Gpf_Data_RecordSet::getSize怎么用?PHP Gpf_Data_RecordSet::getSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gpf_Data_RecordSet的用法示例。


在下文中一共展示了Gpf_Data_RecordSet::getSize方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setData

 private function setData(Gpf_Data_RecordSet $recordSet, $totalCount = null)
 {
     $this->cachedData = $recordSet;
     if ($totalCount == null) {
         $this->size = $this->cachedData->getSize();
         return;
     }
     $this->size = $totalCount;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:9,代码来源:RichListBox.class.php

示例2: getNumberOfSubaffiliates

    public function getNumberOfSubaffiliates($userid = null) {
        $result = new Gpf_Data_RecordSet();
        $selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
        $selectBuilder->select->add('COUNT(u.userid)', 'amount');

        $selectBuilder->from->add(Pap_Db_Table_Users::getName(), "u");
        $selectBuilder->from->addInnerJoin(Gpf_Db_Table_Users::getName(), "gu", "u.accountuserid = gu.accountuserid");
        $selectBuilder->from->addInnerJoin(Gpf_Db_Table_AuthUsers::getName(), "au", "gu.authid = au.authid");

        $selectBuilder->where->add('u.deleted', '=', Gpf::NO);
        if ($userid === null) {
            $selectBuilder->where->add('u.parentuserid', '=', Gpf_Session::getAuthUser()->getPapUserId());
        } else {
            $selectBuilder->where->add('u.parentuserid', '=', $userid);
        }
        $selectBuilder->where->add('gu.rstatus', '<>', 'D');
        if ($this->params->isDateFromDefined()) {
            $selectBuilder->where->add('u.' . Pap_Stats_Table::DATEINSERTED, '>=', $this->params->getDateFrom()->toDateTime());
        }
        if ($this->params->isDateToDefined()) {
            $selectBuilder->where->add('u.' . Pap_Stats_Table::DATEINSERTED, '<=', $this->params->getDateTo()->toDateTime());
        }
        $selectBuilder->limit->set(0, 1);

        $result->load($selectBuilder);

        if($result->getSize() == 0) {
            return 0;
        }

        foreach($result as $record) {
            return $record->get('amount');
        }
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:34,代码来源:SubAffiliateStats.class.php

示例3: getCommissionsDescription

    /**
     * returns text description about campaign commissions
     *
     * @param string $campaignId
     * @param Gpf_Data_RecordSet $rsCommissions
     * @return string
     */
    private function getCommissionsDescription($campaignId, Gpf_Data_RecordSet $rsCommissions) {
    	if($rsCommissions->getSize() == 0) {
    		return $this->_('none active');
    	}
    	
    	$commissions = array();
    	$maxTiers = 1;
    	foreach($rsCommissions as $record) {
    		if($campaignId != $record->get("campaignid")) {
    			continue;
    		}
    		
    		$rType = $record->get('rtype');
    		$tier = $record->get('tier');
    		if($tier > $maxTiers) {
    			$maxTiers = $tier;
    		}
    		$commissions[$rType][$tier]['commtype'] = $record->get(Pap_Db_Table_Commissions::TYPE);
    		$commissions[$rType][$tier]['value'] = $record->get(Pap_Db_Table_Commissions::VALUE);
    	}

    	$description = '';

    	for($i=1; $i<=$maxTiers; $i++) {
    		if(isset($commissions[Pap_Common_Constants::TYPE_CPM][$i])) {
    			$description .= ($description != '' ? ', ' : '');
    			$description .= $this->_('CPM').': '.Pap_Common_Utils_CurrencyUtils::toStandardCurrencyFormat($commissions[Pap_Common_Constants::TYPE_CPM][$i]['value']);
    		}
    		if(isset($commissions[Pap_Common_Constants::TYPE_CLICK][$i])) {
    			$description .= ($description != '' ? ', ' : '');
    			$description .= $this->_('per click').': '.Pap_Common_Utils_CurrencyUtils::toStandardCurrencyFormat($commissions[Pap_Common_Constants::TYPE_CLICK][$i]['value']);
    		}
    		if(isset($commissions[Pap_Common_Constants::TYPE_SALE][$i])) {
    			$description .= ($description != '' ? ', ' : '');

    			$description .= $this->_('per sale').': '.
    			Pap_Common_Utils_CurrencyUtils::toStandardCurrencyFormat($commissions[Pap_Common_Constants::TYPE_SALE][$i]['value'],
    			$commissions[Pap_Common_Constants::TYPE_SALE][$i]['commtype']);
    		}

    	}
    	if($description == '') {
    		$description = $this->_('none active');
    	}
    	
    	return $description;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:54,代码来源:Campaigns.class.php

示例4: checkUserApprovedDirectLinks

    public function checkUserApprovedDirectLinks($userId) {
        $result = new Gpf_Data_RecordSet();
        $selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
        $selectBuilder->select->add('COUNT('.Pap_Db_Table_DirectLinkUrls::ID.')', 'count');
        $selectBuilder->from->add(Pap_Db_Table_DirectLinkUrls::getName());
        $selectBuilder->where->add(Pap_Db_Table_DirectLinkUrls::USER_ID, '=', $userId);
        $selectBuilder->where->add(Pap_Db_Table_DirectLinkUrls::STATUS, '=', Pap_Common_Constants::STATUS_APPROVED);

        $result->load($selectBuilder);

        if($result->getSize() == 0) {
            return false;
        }

        foreach($result as $record) {
            if($record->get('count') > 0) {
                return true;
            }
            break;
        }

        return false;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:23,代码来源:DirectLinkUrl.class.php

示例5: fill

 public function fill(Gpf_Data_RecordSet $data)
 {
     $this->rows = $data;
     $this->from = 0;
     $this->to = $this->count = $data->getSize();
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:6,代码来源:Table.class.php

示例6: getDefaultCurrency

 /**
  * returns default currency or an exception
  *
  * @return Gpf_Db_Currency
  */
 public static function getDefaultCurrency()
 {
     $result = new Gpf_Data_RecordSet();
     $selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
     $selectBuilder->select->add(Gpf_Db_Table_Currencies::ID, 'currencyid');
     $selectBuilder->select->add(Gpf_Db_Table_Currencies::NAME, 'name');
     $selectBuilder->select->add(Gpf_Db_Table_Currencies::SYMBOL, 'symbol');
     $selectBuilder->select->add(Gpf_Db_Table_Currencies::PRECISION, 'cprecision');
     $selectBuilder->select->add(Gpf_Db_Table_Currencies::IS_DEFAULT, 'isdefault');
     $selectBuilder->select->add(Gpf_Db_Table_Currencies::WHEREDISPLAY, 'wheredisplay');
     $selectBuilder->select->add(Gpf_Db_Table_Currencies::EXCHANGERATE, 'exchrate');
     $selectBuilder->from->add(Gpf_Db_Table_Currencies::getName());
     $selectBuilder->where->add('isdefault', '=', 1);
     $selectBuilder->limit->set(0, 1);
     $result->load($selectBuilder);
     if ($result->getSize() == 0) {
         throw new Gpf_DbEngine_NoRowException($selectBuilder);
     }
     foreach ($result as $record) {
         $currency = new Gpf_Db_Currency();
         $currency->fillFromRecord($record);
         return $currency;
     }
     throw new Gpf_DbEngine_NoRowException($selectBuilder);
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:30,代码来源:AffiliateSignup.php

示例7: checkUserIsInCampaign

    /**
     * checks if user is in campaign, if yes, it will return valid commissionGroupID,
     * otherwise it returns false
     *
     * @param string $userId
     * @return string or false
     */
    public function checkUserIsInCampaign($userId) {
        $result = new Gpf_Data_RecordSet();
        $selectBuilder = new Gpf_SqlBuilder_SelectBuilder();
        $selectBuilder->select->add('u.usercommgroupid', 'usercommgroupid');
        $selectBuilder->select->add('u.commissiongroupid', 'commissiongroupid');
        $selectBuilder->select->add('u.rstatus', 'rstatus');
        $selectBuilder->from->add('qu_pap_userincommissiongroup', 'u');
        $selectBuilder->from->addInnerJoin('qu_pap_commissiongroups', 'g',
            'u.commissiongroupid=g.commissiongroupid');

        $selectBuilder->where->add('g.campaignid', '=', $this->getId());
        $selectBuilder->where->add('u.userid', '=', $userId);
        $selectBuilder->limit->set(0, 1);

        $result->load($selectBuilder);

        if($result->getSize() == 0) {
            return false;
        }

        foreach($result as $record) {
            if($this->isUserCommissionGroupStatusAllowed($record->get('rstatus'))) {
                return $record->get('commissiongroupid');
            }
            break;
        }

        return false;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:36,代码来源:Campaign.class.php

示例8: getCommissionsDescription

	/**
	 * returns text description about campaign commissions
	 *
	 * @param string $campaignId
	 * @param Gpf_Data_RecordSet $rsCommissions
	 * @return string
	 */
	public function getCommissionsDescription($campaignId, Gpf_Data_RecordSet $rsCommissions, $commissionGroupId = null, $extendedFormatting = false) {
		if ($rsCommissions->getSize() == 0) {
			return $this->_('none active !');
		}

		if ($commissionGroupId == null) {
			try {
				$commissionGroupId = $this->getDefaultCommissionGroup($campaignId);
			} catch (Gpf_Exception $e) {
				return $this->_('none active');
			}
		}

		$commissions = array();
		foreach ($rsCommissions as $record) {
			if ($campaignId != $record->get("campaignid") ||
			($commissionGroupId != '' && $commissionGroupId != $record->get("commissiongroupid"))) {
				continue;
			}

			$rType = $record->get('rtype');
			$commissions[$rType]['commtype'] = $record->get(Pap_Db_Table_Commissions::TYPE);
			$commissions[$rType]['value'] = $record->get(Pap_Db_Table_Commissions::VALUE);
			switch ($rType) {
				case Pap_Common_Constants::TYPE_CPM:
					$commissionTypeName = $this->_('CPM');
					break;
				case Pap_Common_Constants::TYPE_CLICK:
					$commissionTypeName = $this->_('per click');
					break;
				case Pap_Common_Constants::TYPE_SALE:
					$commissionTypeName = $this->_('per sale / lead');
					break;
				default:
					$commissionTypeName = $record->get('commissionTypeName');
					break;
			}
			$commissions[$rType]['name'] = $commissionTypeName;
		}

		$description = '';
		if ($extendedFormatting) {
			foreach ($commissions as $rtype => $commission) {
				$description .= ($description != '' ? '<br>' : '');
				$description .= $commission['name'].': <strong>'.Pap_Common_Utils_CurrencyUtils::toStandardCurrencyFormat($commission['value'], $commission['commtype']).'</strong>';
			}
		} else {
			foreach ($commissions as $rtype => $commission) {
				$description .= ($description != '' ? ', ' : '');
				$description .= $commission['name'].': '.Pap_Common_Utils_CurrencyUtils::toStandardCurrencyFormat($commission['value'], $commission['commtype']);
			}
		}
		if($description == '') {
			$description = $this->_('none active');
		}

		return $description;
	}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:65,代码来源:Commissions.class.php

示例9: 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;
    }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:21,代码来源:RichListBoxService.class.php


注:本文中的Gpf_Data_RecordSet::getSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。