public function changeWotd($id)
 {
     $termManager = new \Manager\TermManager();
     $wotd = $termManager->getCurrentWordOfTheDay();
     debug($wotd);
     $termManager->update(['is_wotd' => 0], $wotd['id']);
     $termManager->update(['is_wotd' => 1], $id);
     $this->redirectToRoute('show_all_terms');
 }
Exemple #2
0
 public function change_Wotd($id)
 {
     $termManager = new \Manager\TermManager();
     $wotd = $termManager->getCurrentWordOfTheDay();
     // $Wotd = termManager->getRandomWord();
     $termManager->update(["is_wotd" => 0], $wotd['id']);
     $termManager->update(["is_wotd" => 1], $id);
     $this->redirectToRoute('show_all_terms');
 }
Exemple #3
0
 public function changeWotd($id)
 {
     $termManager = new \Manager\TermManager();
     //sélectionner le mot du jour actuel
     $wotd = $termManager->getCurrentWordOfTheDay();
     //faire un update sur l'ancien mot du jour pour le mettre à 0
     $termManager->update(["is_wotd" => 0], $wotd['id']);
     //faire un update sur le nouveau terme pour le mettre à 1
     $termManager->update(["is_wotd" => 1], $id);
     //rediriger vers la page d'accueil
     $this->redirectToRoute('show_all_terms');
 }
 public function changeWotd()
 {
     $this->allowTo('admin');
     $termManager = new \Manager\TermManager();
     $wotd = $termManager->getCurrentWordOfTheDay();
     //Sélectionner aléatoirement un terme où le wotd est égal à 0
     $newWotd = $termManager->getRandomWordOfTheDay();
     $dataWotd = array('is_wotd' => 0);
     $dataNewWotd = array('is_wotd' => 1);
     $termManager->update($dataWotd, $wotd['id']);
     $termManager->update($dataNewWotd, $newWotd['id']);
     $this->redirectToRoute('show_wotd');
 }