public function Ajouter() { // On ajoute le grade. $retour = parent::Ajouter(); // On ajoute au grade les joueurs qui y appartiennent. $listeGradesJoueurs = $this->ListeGradesJoueurs(); if ($retour !== false && $listeGradesJoueurs !== NULL) { $listeGradesJoueurs->SetListeChampValeur(COL_GRADE, $this->Id()); $retour = $listeGradesJoueurs->Ajouter(); } return $retour; }
public function Ajouter() { // On ajoute l'objet avec comme ordre l'ordre max + 1. $this->AjouterColInsertionMax(COL_ORDRE, 1); if (is_string($this->colOrdre)) { $this->AjouterColCondition($this->colOrdre); } else { if (is_array($this->colOrdre)) { foreach ($this->colOrdre as $col) { $this->AjouterColCondition($col); } } } return parent::Ajouter(); }
public function Ajouter() { // Ouverture de la transaction si on ne l'ai pas déjà. $dejaEnTransaction = GBase::EstEnTransaction(); if ($dejaEnTransaction === false) { GBase::DemarrerTransaction(); } // On inscrit le nouveau libellé dans la base avec l'id max + 1 comme id. $mLibelle = $this->LibelleObj(); $mLibelle->AjouterColInsertionMax(COL_ID, 1); $retour = $mLibelle->Ajouter(); if ($retour !== false) { // On récupère l'id max qui est l'id de notre libellé. $mLibelle->AjouterColSelectionMax(COL_ID); $retour = $mLibelle->Charger(); if ($retour !== false) { // Fermeture de la transaction si on ne l'était pas déjà. if ($dejaEnTransaction === false) { GBase::ValiderTransaction(); } // On copie le libellé pour toutes les autres langues. $mListeLibelles = new MListeLibelles(); $mListeLibelles->AjouterJointure(COL_LANGUE, COL_ID, 0, SQL_CROSS_JOIN); $mListeLibelles->AjouterColInsertionExt(0, COL_ID, COL_ID); $mListeLibelles->AjouterColInsertionExt(0, COL_LIBELLE, COL_LIBELLE); $mListeLibelles->AjouterColInsertionExt(0, COL_TYPELIBELLE, COL_TYPELIBELLE); $mListeLibelles->AjouterColInsertionExt(0, COL_LANGUEORIGINELLE, COL_LANGUEORIGINELLE); $mListeLibelles->AjouterColInsertionExt(1, COL_LANGUE, COL_ID); $mListeLibelles->AjouterFiltreEgal(COL_ID, $mLibelle->Id()); $mListeLibelles->AjouterFiltreDifferentPourJointure(1, COL_ID, GSession::Langue(COL_ID)); $mListeLibelles->Ajouter(); $this->Libelle(NULL, $mLibelle->Id()); // On ajoute ensuite l'objet normalement. return parent::Ajouter(); } } if ($dejaEnTransaction === false) { GBase::AnnulerTransaction(); } return $retour; }