예제 #1
0
 public function Supprimer()
 {
     $retour = true;
     $listeGradesJoueurs = $this->ListeGradesJoueurs();
     if ($listeGradesJoueurs !== NULL) {
         $retour = $listeGradesJoueurs->Supprimer();
     }
     if ($retour !== false) {
         $retour = parent::Supprimer();
     }
     return $retour;
 }
예제 #2
0
 public function Supprimer()
 {
     // On supprime le libellé dans toutes les langues.
     $mLibelle = $this->AjouterJointure(COL_LIBELLE, COL_ID);
     $mLibelle->SupprimerSurJointure(true);
     return parent::Supprimer();
 }
예제 #3
0
 public function Supprimer()
 {
     // Ouverture de la transaction si on ne l'ai pas déjà.
     $dejaEnTransaction = GBase::EstEnTransaction();
     if ($dejaEnTransaction === false) {
         GBase::DemarrerTransaction();
     }
     // On récupère l'ordre de l'élément.
     if (is_string($this->colOrdre)) {
         $this->AjouterColSelection($this->colOrdre);
     } else {
         if (is_array($this->colOrdre)) {
             foreach ($this->colOrdre as $col) {
                 $this->AjouterColSelection($col);
             }
         }
     }
     $this->AjouterColSelection(COL_ORDRE);
     $retour = $this->Charger();
     // On récupère la liste relative au type d'élément afin de décrémenter l'ordre des éléments
     // possédant un ordre supérieur à celui qui va être supprimé.
     $mListe = $this->GetNouvelleListe();
     if ($mListe === NULL) {
         GLog::LeverException(EXM_0210, $this->GetNom() . '::Supprimer, impossible de récupérer un objet liste.');
         $retour = false;
     } else {
         if ($this->Ordre() === NULL) {
             GLog::LeverException(EXM_0211, $this->GetNom() . '::Supprimer, impossible de récupérer l\'ordre de l\'élément d\'id [' . $this->Id() . '].');
             $retour = false;
         }
     }
     $log = true;
     // On supprime l'élément.
     if ($retour !== false) {
         $retour = parent::Supprimer();
         // On décrémente l'ordre des éléments possédant un ordre supérieur à celui qui a été supprimé.
         if ($retour !== false) {
             $mListe->AjouterColModificationExt(0, COL_ORDRE, COL_ORDRE, -1);
             $mListe->AjouterFiltreSuperieur(COL_ORDRE, $this->Ordre());
             if (is_string($this->colOrdre)) {
                 $mListe->AjouterFiltreEgal($this->colOrdre, $this->GetChampSQL($this->colOrdre));
             } else {
                 if (is_array($this->colOrdre)) {
                     foreach ($this->colOrdre as $col) {
                         $mListe->AjouterFiltreEgal($col, $this->GetChampSQL($col));
                     }
                 }
             }
             $retour = $mListe->Modifier();
         } else {
             $log = false;
         }
     }
     // Si on a créé nous même la transaction dans cette fonction, on commit ou rollback suivant le résultat.
     if ($dejaEnTransaction === false) {
         if ($retour === false) {
             GBase::AnnulerTransaction();
         } else {
             GBase::ValiderTransaction();
         }
     }
     if ($retour === false && $log === true) {
         GLog::LeverException(EXM_0212, $this->GetNom() . '::Supprimer, échec de la suppression en base.');
     }
     return $retour;
 }