public function executeTags() { $this->getResponse()->setTitle(sfConfig::get('app_main_title') . ' - i miei argomenti'); // embed javascripts for advanced javascripts $response = sfContext::getInstance()->getResponse(); // fetch current user profile $this->opp_user = OppUserPeer::retrieveByPK($this->getUser()->getId()); $this->redirectUnless($this->opp_user instanceof OppUser, '/'); // fetch teseo top_terms and add monitoring info $teseo_tts_with_counts = OppTeseottPeer::getAllWithCount(); foreach ($teseo_tts_with_counts as $term_id => $term_data) { $teseo_tts_with_counts[$term_id]['n_monitored'] = OppTeseottPeer::countTagsUnderTermMonitoredByUser($term_id, $this->opp_user->getId()); } $this->teseo_tts_with_counts = $teseo_tts_with_counts; // get user's monitored tags as a cloud $c = new Criteria(); $c->add(TagPeer::ID, $this->opp_user->getMonitoredPks('Tag'), Criteria::IN); $this->my_tags = TagPeer::getPopulars($c); $this->remaining_tags = $this->opp_user->getNMaxMonitoredTags() - $this->opp_user->countMonitoredObjects('Tag'); }