本文整理汇总了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);
}
示例2: top
private function top($data)
{
$limit = $this->getRequestParameter("limit", '6');
$includeProposals = $this->getRequestParameter("proposals", false);
$exclude = "";
return EntityManager::getTopEntities($limit, $exclude, 'Entity', $includeProposals);
}