public static function getLatestActivities($limit = 0)
 {
     $c = new Criteria();
     $c->addDescendingOrderByColumn(CommunityNewsPeer::CREATED_AT);
     if ($limit != 0) {
         $c->setLimit($limit);
     }
     return CommunityNewsPeer::doSelect($c);
 }
 public function executeIndex()
 {
     $this->getResponse()->setTitle('Monitora i tuoi rappresentanti - ' . sfConfig::get('app_main_title'));
     $this->getResponse()->addMeta('description', 'Cosa fanno i tuoi rappresentanti? Tutte le attività parlamentari aggiornate quotidianamente.', true);
     deppFiltersAndSortVariablesManager::resetVars($this->getUser(), 'module', 'module', array('acts_filter', 'sf_admin/opp_atto/sort', 'votes_filter', 'sf_admin/opp_votazione/sort', 'pol_camera_filter', 'pol_senato_filter', 'sf_admin/opp_carica/sort', 'argomento/atti_filter', 'argomento_leggi/sort', 'argomento_nonleg/sort', 'monitoring_filter'));
     // ultime attivita' della community
     $this->latest_activities = CommunityNewsPeer::getLatestActivities(4);
     // ultime news dal parlamento
     $c = oppNewsPeer::getHomeNewsCriteria();
     $c->addDescendingOrderByColumn(NewsPeer::DATE);
     $itemsperpage = 4;
     $pager = new deppNewsPager('News', $itemsperpage);
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
     // atti in evidenza
     $this->lanci = array();
     $c = new Criteria();
     $c->add(sfLaunchingPeer::LAUNCH_NAMESPACE, 'home');
     $c->add(sfLaunchingPeer::OBJECT_MODEL, 'OppAtto');
     $c->setLimit(8);
     $c->addDescendingOrderByColumn(sfLaunchingPeer::PRIORITY);
     $evidences = sfLaunchingPeer::doSelect($c);
     foreach ($evidences as $evidence) {
         $atto = OppAttoPeer::retrieveByPk($evidence->getObjectId());
         $this->lanci[] = $atto->getId();
     }
     // post del blog
     $this->post_pager = sfSimpleBlogPostPeer::getTaggedPager('in evidenza', sfConfig::get('app_sfSimpleBlog_post_max_per_page', 10), $this->getRequestParameter('page', 1));
     // estrae le circoscrizioni, compreso il valore 0
     $this->senato_constituencies = OppCaricaPeer::getAllConstituencies('senato', false);
     $this->camera_constituencies = OppCaricaPeer::getAllConstituencies('camera', false);
 }
 public function executeComunita()
 {
     $this->getResponse()->setTitle("le ultime 100 attivita' della comunita' - " . sfConfig::get('app_main_title'));
     $this->response->addMeta('description', 'Tutte le notizie aggiornate quotidianamente sulle azioni degli utenti di openparlamento', true);
     $this->latest_activities = CommunityNewsPeer::getLatestActivities(100);
 }
 /**
  * Executes index action
  *
  */
 public function executeIndex()
 {
     $this->getResponse()->setTitle('Le attività della community - ' . sfConfig::get('app_main_title'));
     // ultime 10 attivita' della community
     $this->latest_activities = CommunityNewsPeer::getLatestActivities(10);
 }
 /**
  * return news generated by this generator
  *
  * @return array of Objects
  * @author Guglielmo Celata
  **/
 public function getGeneratedNews(BaseObject $object)
 {
     return CommunityNewsPeer::getNewsGeneratedByGenerator($object);
 }
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(CommunityNewsPeer::ID, $pks, Criteria::IN);
         $objs = CommunityNewsPeer::doSelect($criteria, $con);
     }
     return $objs;
 }