/** * @name recherche( $pTypeRecherche, $pTypeCritere, $pCritereRecherche, $pTypeTri, $pCritereTri ) * @param string nom de la table * @param string Le type de critère de recherche * @param array(string) champs à récupérer dans la table * @param array(array(string, object)) Dictionnaire(champ, valeur)) contenant les champs à filtrer ainsi que la valeur du filtre * @param array(array(string, string)) Dictionnaire(champ, sens) contenant les tris à appliquer * @return array(InformationBancaireVO) * @desc Récupères les lignes de la table selon le critère de recherche puis trie et renvoie la liste de résultat sous forme d'une collection de InformationBancaireVO */ public static function recherche($pTypeRecherche, $pTypeCritere, $pCritereRecherche, $pTypeTri, $pCritereTri) { // Initialisation du Logger $lLogger =& Log::singleton('file', CHEMIN_FICHIER_LOGS); $lLogger->setMask(Log::MAX(LOG_LEVEL)); // Préparation de la requète $lChamps = array(InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_ID . "," . InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_ID_COMPTE . "," . InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_NUMERO_COMPTE . "," . InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_RAISON_SOCIALE . "," . InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_DATE_CREATION . "," . InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_DATE_MODIFICATION . "," . InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_ETAT); // Préparation de la requète de recherche $lRequete = DbUtils::prepareRequeteRecherche(InformationBancaireManager::TABLE_INFORMATIONBANCAIRE, $lChamps, $pTypeRecherche, $pTypeCritere, $pCritereRecherche, $pTypeTri, $pCritereTri); $lListeInformationBancaire = array(); if ($lRequete !== false) { $lLogger->log("Execution de la requete : " . $lRequete, PEAR_LOG_DEBUG); // Maj des logs $lSql = Dbutils::executerRequete($lRequete); if (mysql_num_rows($lSql) > 0) { while ($lLigne = mysql_fetch_assoc($lSql)) { array_push($lListeInformationBancaire, InformationBancaireManager::remplirInformationBancaire($lLigne[InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_ID], $lLigne[InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_ID_COMPTE], $lLigne[InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_NUMERO_COMPTE], $lLigne[InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_RAISON_SOCIALE], $lLigne[InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_DATE_CREATION], $lLigne[InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_DATE_MODIFICATION], $lLigne[InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_ETAT])); } } else { $lListeInformationBancaire[0] = new InformationBancaireVO(); } return $lListeInformationBancaire; } $lListeInformationBancaire[0] = new InformationBancaireVO(); return $lListeInformationBancaire; }
/** * @name getByIdCompte($pIdCompte) * @param integer * @return InformationBancaireVO * @desc Retourne une Information Bancaire correpondant au compte zeybux */ public function getByIdCompte($pIdCompte) { $lInformationBancaire = InformationBancaireManager::recherche(array(InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_ID_COMPTE, InformationBancaireManager::CHAMP_INFORMATIONBANCAIRE_ETAT), array('=', '='), array($pIdCompte, 0), array(''), array('')); return $lInformationBancaire[0]; }