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


PHP EntityManager::getTopEntities方法代码示例

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


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

示例1: executeIndex

 public function executeIndex(sfWebRequest $request)
 {
     $culture = $this->getUser()->getCulture();
     $cpos = new Criteria();
     $cpos->add(SfReviewPeer::VALUE, 1);
     $cpos->add(SfReviewPeer::IS_ACTIVE, 1);
     //$cpos->add(SfReviewPeer::CULTURE, $culture);
     $this->totalUpReviews = SfReviewPeer::doCount($cpos);
     $cneg = new Criteria();
     $cneg->add(SfReviewPeer::VALUE, -1);
     $cneg->add(SfReviewPeer::IS_ACTIVE, 1);
     //$cneg->add(SfReviewPeer::CULTURE, $culture);
     $this->totalDownReviews = SfReviewPeer::doCount($cneg);
     $exclude = "";
     $this->reviewables = EntityManager::getTopEntities(6, $exclude, "WebEntity", true);
     $c = new Criteria();
     $c->addDescendingOrderByColumn(PoliticoPeer::SUMU);
     $c->addAscendingOrderByColumn(PoliticoPeer::SUMD);
     $c->setLimit(5);
     $this->topPoliticos = PoliticoPeer::doSelect($c);
     $c = new Criteria();
     $c->addDescendingOrderByColumn(PartidoPeer::SUMU);
     $c->addAscendingOrderByColumn(PartidoPeer::SUMD);
     $c->setLimit(5);
     $c->add(PartidoPeer::IS_ACTIVE, true);
     $this->partidosMasVotados = PartidoPeer::doSelect($c);
     $c = new Criteria();
     $c->addDescendingOrderByColumn(PropuestaPeer::SUMU);
     $c->addAscendingOrderByColumn(PropuestaPeer::SUMD);
     $c->setLimit(5);
     $c->add(PropuestaPeer::IS_ACTIVE, true);
     $c->add(PropuestaPeer::CULTURE, $culture);
     $this->propuestasMasVotadas = PropuestaPeer::doSelect($c);
     //Totales
     /*
     $c = new Criteria();
     $this->totalPoliticos = PoliticoPeer::doCount($c);
     $c = new Criteria();
     $c->add(PartidoPeer::IS_ACTIVE, true);
     $this->totalPartidos = PartidoPeer::doCount($c);
     $c = new Criteria();
     $c->add(PropuestaPeer::IS_ACTIVE, true);
     $c->add(PropuestaPeer::CULTURE, $culture);
     $this->totalPropuestas = PropuestaPeer::doCount($c);
     */
     $this->response->addMeta('Description', sfContext::getInstance()->getI18N()->__('Comparte opiniones sobre políticos y partidos de España. Ranking de los políticos y partidos más votados.'));
     // Ultimos comentarios
     $filter = array();
     $filter['culture'] = $culture;
     //$this->topReviews = SfReviewManager::getReviews($filter, 1, 5);
     $this->activities = SfReviewManager::getActivities($filter, 1, 5);
     // elecciones destacadas
     $convocatoriaActiva = sfConfig::get('sf_convocatoria_activa');
     $this->convocatoria = ConvocatoriaPeer::retrieveByPk($convocatoriaActiva);
 }
开发者ID:voota,项目名称:voota,代码行数:55,代码来源:actions.class.php

示例2: top

 private function top($data)
 {
     $limit = $this->getRequestParameter("limit", '6');
     $includeProposals = $this->getRequestParameter("proposals", false);
     $exclude = "";
     return EntityManager::getTopEntities($limit, $exclude, 'Entity', $includeProposals);
 }
开发者ID:voota,项目名称:voota,代码行数:7,代码来源:actions.class.php


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