/** * Delete all given flashards, returns an array of ids of flashcards * that were succesfully deleted. * * @param object $userId * @param object $selection * * @return array Array of successfully deleted flashcards (ids) or false */ public static function deleteSelection($userId, array $cardSelection) { $cards = ReviewsPeer::deleteFlashcards($userId, $cardSelection); if (is_array($cards) && count($cards)) { ActiveMembersPeer::updateFlashcardCount($userId); } return $cards; }
public function execute($request) { $queryParams = $this->getUser()->getLocalPrefs()->syncRequestParams('memberslist', array(uiSelectPager::QUERY_ROWSPERPAGE => 50, uiSelectTable::QUERY_SORTCOLUMN => 'ts_lastreview', uiSelectTable::QUERY_SORTORDER => 1)); // pager $this->pager = new uiSelectPager(array('select' => ActiveMembersPeer::getSelectForActiveMembersList(), 'internal_uri' => '@members_list', 'query_params' => $queryParams, 'max_per_page' => $queryParams[uiSelectPager::QUERY_ROWSPERPAGE], 'page' => $request->getParameter(uiSelectPager::QUERY_PAGENUM, 1))); $this->pager->init(); // data table $this->table = new uiSelectTable(new MembersListBinding(), $this->pager->getSelect(), $request->getParameterHolder()); return coreView::SUCCESS; }
/** * Save information from the last flashcard review session in the database. * Allows to see the last review session results on subsequent GET request, * and until the user starts another review session. * * The data could also be used in the active member statistics, .. * * @param object $params */ protected function saveReviewSessionInfo(sfParameterHolder $params) { $data = array('ts_start' => $params->get('ts_start'), 'fc_pass' => $params->get('fc_pass'), 'fc_fail' => $params->get('fc_fail')); ActiveMembersPeer::saveReviewSummaryInfo($this->getUser()->getUserId(), $data); }
/** * Display the active members list. * */ public function executeMemberslist($request) { ActiveMembersPeer::deleteInactiveMembers(); }