Exemple #1
0
 /**
  * Add a set of new flashcard to the user's deck.
  * 
  * Duplicates and ids that laready exist in the user's deck must
  * be checked before (cf. checkSelection()).
  * 
  * @param object $userId
  * @param object $newCards
  * 
  * @return array  Array of successfully added flashcard ids
  */
 public static function addSelection($userId, array $cardSelection)
 {
     // create new flashcards
     $cards = ReviewsPeer::addFlashcards($userId, $cardSelection);
     if (count($cards)) {
         ActiveMembersPeer::updateFlashcardCount($userId);
     }
     return $cards;
 }