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


PHP PartnerPeer::doCount方法代码示例

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


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

示例1: execute

 public function execute()
 {
     $this->forceSystemAuthentication();
     $start = microtime(true);
     $limit = 7;
     // new partners
     $c = new Criteria();
     $this->partner_count = PartnerPeer::doCount($c);
     // count before setting the limit
     $c->setLimit($limit);
     $c->addDescendingOrderByColumn(PartnerPeer::CREATED_AT);
     $newest_partners = PartnerPeer::doSelect($c);
     //		$new_partners_ids = self::getIds( $new_partners );
     // fetch stats for these partners
     // TODO - if new - what statistics could it have ??
     //		fdb::populateObjects( $newest_partners , new PartnerStatsPeer() , "id" , "partnerStats" , false ,"partnerId");
     $exclude = $this->getP("exclude");
     if ($exclude) {
         self::addToExceludeList($exclude);
     }
     $exclude_list = self::getExceludeList();
     // most viewed
     $c = new Criteria();
     $c->add(PartnerStatsPeer::PARTNER_ID, $exclude_list, Criteria::NOT_IN);
     $c->setLimit($limit);
     $c->addDescendingOrderByColumn(PartnerStatsPeer::VIEWS);
     $stats_most_views = PartnerStatsPeer::doSelect($c);
     $most_views = self::getPartnerListFromStats($stats_most_views);
     // most entries
     $c = new Criteria();
     $c->add(PartnerStatsPeer::PARTNER_ID, $exclude_list, Criteria::NOT_IN);
     $c->setLimit($limit);
     $c->addDescendingOrderByColumn(PartnerStatsPeer::ENTRIES);
     $stats_most_entries = PartnerStatsPeer::doSelect($c);
     $most_entries = self::getPartnerListFromStats($stats_most_entries);
     $end = microtime(true);
     $this->newest_partners = $newest_partners;
     $this->most_views = $most_views;
     $this->most_entries = $most_entries;
     $this->bench = $end - $start;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:41,代码来源:showtimeAction.class.php

示例2: countPartners

 /**
  * Returns the number of related Partner objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      PropelPDO $con
  * @return     int Count of related Partner objects.
  * @throws     PropelException
  */
 public function countPartners(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(kuserPeer::DATABASE_NAME);
     } else {
         $criteria = clone $criteria;
     }
     if ($distinct) {
         $criteria->setDistinct();
     }
     $count = null;
     if ($this->collPartners === null) {
         if ($this->isNew()) {
             $count = 0;
         } else {
             $criteria->add(PartnerPeer::ANONYMOUS_KUSER_ID, $this->id);
             $count = PartnerPeer::doCount($criteria, false, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return count of the collection.
             $criteria->add(PartnerPeer::ANONYMOUS_KUSER_ID, $this->id);
             if (!isset($this->lastPartnerCriteria) || !$this->lastPartnerCriteria->equals($criteria)) {
                 $count = PartnerPeer::doCount($criteria, false, $con);
             } else {
                 $count = count($this->collPartners);
             }
         } else {
             $count = count($this->collPartners);
         }
     }
     return $count;
 }
开发者ID:dozernz,项目名称:server,代码行数:45,代码来源:Basekuser.php

示例3: listAction

 /**
  * @action list
  * @param KalturaPartnerFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaPartnerListResponse
  */
 public function listAction(KalturaPartnerFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (is_null($filter)) {
         $filter = new KalturaPartnerFilter();
     }
     if (is_null($pager)) {
         $pager = new KalturaFilterPager();
     }
     $partnerFilter = new partnerFilter();
     $filter->toObject($partnerFilter);
     $partnerFilter->set('_gt_id', 0);
     $c = new Criteria();
     $partnerFilter->attachToCriteria($c);
     $totalCount = PartnerPeer::doCount($c);
     $pager->attachToCriteria($c);
     $list = PartnerPeer::doSelect($c);
     $newList = KalturaPartnerArray::fromPartnerArray($list);
     $response = new KalturaPartnerListResponse();
     $response->totalCount = $totalCount;
     $response->objects = $newList;
     return $response;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:28,代码来源:SystemPartnerService.php

示例4: countAction

 /**
  * Count partner's existing sub-publishers (count includes the partner itself).
  * 
  * @action count
  * @param KalturaPartnerFilter $filter
  * @return int
  */
 public function countAction(KalturaPartnerFilter $filter = null)
 {
     if (!$filter) {
         $filter = new KalturaPartnerFilter();
     }
     $dbFilter = new partnerFilter();
     $filter->toObject($dbFilter);
     $c = PartnerPeer::getDefaultCriteria();
     $dbFilter->attachToCriteria($c);
     return PartnerPeer::doCount($c);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:18,代码来源:PartnerService.php

示例5: getPartnerUsageAction

 /**
  * Function which calulates partner usage of a group of a VAR's sub-publishers
  * 
  * @action getPartnerUsage
  * @param KalturaPartnerFilter $partnerFilter
  * @param KalturaReportInputFilter $usageFilter
  * @param KalturaFilterPager $pager
  * @return KalturaPartnerUsageListResponse
  * @throws KalturaVarConsoleErrors::MAX_SUB_PUBLISHERS_EXCEEDED
  */
 public function getPartnerUsageAction(KalturaPartnerFilter $partnerFilter = null, KalturaReportInputFilter $usageFilter = null, KalturaFilterPager $pager = null)
 {
     if (is_null($partnerFilter)) {
         $partnerFilter = new KalturaPartnerFilter();
     }
     if (is_null($usageFilter)) {
         $usageFilter = new KalturaReportInputFilter();
         $usageFilter->fromDate = time() - 60 * 60 * 24 * 30;
         // last 30 days
         $usageFilter->toDate = time();
     } else {
         //The first time the filter is sent, it it sent with 0 as fromDate
         if (!$usageFilter->fromDate) {
             $usageFilter->fromDate = time() - 60 * 60 * 24 * 30;
         }
         if (!$usageFilter->interval) {
             $usageFilter->interval = KalturaReportInterval::MONTHS;
         }
     }
     if (is_null($pager)) {
         $pager = new KalturaFilterPager();
     }
     //Create a propel filter for the partner
     $partnerFilterDb = new partnerFilter();
     $partnerFilter->toObject($partnerFilterDb);
     //add filter to criteria
     $c = PartnerPeer::getDefaultCriteria();
     $partnerFilterDb->attachToCriteria($c);
     $partnersCount = PartnerPeer::doCount($c);
     if ($partnersCount > self::MAX_SUB_PUBLISHERS) {
         throw new KalturaAPIException(KalturaVarConsoleErrors::MAX_SUB_PUBLISHERS_EXCEEDED);
     }
     $partners = PartnerPeer::doSelect($c);
     $partnerIds = array();
     foreach ($partners as &$partner) {
         $partnerIds[] = $partner->getId();
     }
     // add pager to criteria
     $pager->attachToCriteria($c);
     $c->addAscendingOrderByColumn(PartnerPeer::ID);
     // select partners
     $items = array();
     $inputFilter = new reportsInputFilter();
     $inputFilter->from_date = $usageFilter->fromDate;
     $inputFilter->to_date = $usageFilter->toDate;
     $inputFilter->from_day = date("Ymd", $usageFilter->fromDate);
     $inputFilter->to_day = date("Ymd", $usageFilter->toDate);
     $inputFilter->timeZoneOffset = $usageFilter->timeZoneOffset;
     $inputFilter->interval = $usageFilter->interval;
     if (!count($partnerIds)) {
         $total = new KalturaVarPartnerUsageTotalItem();
         // no partners fit the filter - don't fetch data
         $totalCount = 0;
         // the items are set to an empty KalturaSystemPartnerUsageArray
     } else {
         $totalCount = 0;
         $orderBy = ($inputFilter->interval == reportInterval::MONTHS ? "+month_id" : "+date_id") . ",+partner_id";
         list($reportHeader, $reportData, $totalCount) = myReportsMgr::getTable(null, myReportsMgr::REPORT_TYPE_VAR_USAGE, $inputFilter, $pager->pageSize, $pager->pageIndex, $orderBy, implode(",", $partnerIds));
         foreach ($reportData as $line) {
             $item = new KalturaVarPartnerUsageItem();
             $item->fromString($reportHeader, $line);
             if ($item) {
                 $items[] = $item;
             }
         }
         list($reportHeader, $reportData) = myReportsMgr::getTotal(null, myReportsMgr::REPORT_TYPE_PARTNER_USAGE, $inputFilter, implode(",", $partnerIds));
         $total = new KalturaVarPartnerUsageTotalItem();
         $total->fromString($reportHeader, $reportData);
         list($peakStoragereportHeader, $peakStoragereportData) = myReportsMgr::getTotal(null, myReportsMgr::REPORT_TYPE_PEAK_STORAGE, $inputFilter, implode(",", $partnerIds));
         if ($peakStoragereportData[0]) {
             $total->peakStorage = ceil(@$peakStoragereportData[0]);
         }
     }
     $response = new KalturaPartnerUsageListResponse();
     //Sort according to dateId and partnerId
     uasort($items, array($this, 'sortByDate'));
     $response->total = $total;
     $response->totalCount = $totalCount;
     $response->objects = $items;
     return $response;
 }
开发者ID:DBezemer,项目名称:server,代码行数:91,代码来源:VarConsoleService.php


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