Example #1
0
 /**
  * Creates a flashcard resource.
  *
  * @param Deck $deck
  *
  * @return Deck
  */
 public function create(Deck $deck)
 {
     foreach ($deck->getUserPreferences() as $userPref) {
         $this->om->persist($userPref);
     }
     $this->om->persist($deck);
     $this->om->flush();
     return $deck;
 }
 /**
  * @EXT\Route("/deck/get_all_themes", name="claroline_get_all_themes")
  * @EXT\Method("GET")
  *
  * @return array
  */
 public function getAllThemesAction()
 {
     $response = new JsonResponse();
     return $response->setData(Deck::getAllThemes());
 }
Example #3
0
 /**
  * @param Deck     $deck
  * @param NoteType $noteType
  *
  * @return array
  */
 public function findByNoteType(Deck $deck, NoteType $noteType)
 {
     $repo = $this->om->getRepository('ClarolineFlashCardBundle:Note');
     return $repo->findBy(['deck' => $deck->getId(), 'noteType' => $noteType->getId()], ['id' => 'ASC']);
 }