/** * @name selectListeVirementCompte($pIdCompte) * @return array(OperationDetailVO) ou false en erreur * @desc Retourne l'ensemble des virements */ public static function selectListeVirementCompte($pIdCompte) { // Initialisation du Logger $lLogger =& Log::singleton('file', CHEMIN_FICHIER_LOGS); $lLogger->setMask(Log::MAX(LOG_LEVEL)); $lRequete = "SELECT \n\t\t\t ope1." . OperationManager::CHAMP_OPERATION_ID . ", ope1." . OperationManager::CHAMP_OPERATION_DATE . "," . CompteManager::CHAMP_COMPTE_LABEL . ", ope1." . OperationManager::CHAMP_OPERATION_MONTANT . ", ope1." . OperationManager::CHAMP_OPERATION_TYPE_PAIEMENT . "\n\t\tFROM " . OperationManager::TABLE_OPERATION . " ope1 \n\t\tJOIN " . OperationChampComplementaireManager::TABLE_OPERATIONCHAMPCOMPLEMENTAIRE . "\n\t\t\tON ope1." . OperationManager::CHAMP_OPERATION_ID . " = " . OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_OPE_ID . "\n\t\t\tAND " . OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_CHCP_ID . " in (4,5)\n\t\tJOIN " . OperationManager::TABLE_OPERATION . " ope2\n\t\t\tON ope2." . OperationManager::CHAMP_OPERATION_ID . " = " . OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_VALEUR . "\n\t\tLEFT JOIN " . CompteManager::TABLE_COMPTE . "\n\t\t\tON ope2." . OperationManager::CHAMP_OPERATION_ID_COMPTE . " = " . CompteManager::CHAMP_COMPTE_ID . "\n\t\tWHERE ope1." . OperationManager::CHAMP_OPERATION_ID_COMPTE . " = '" . StringUtils::securiser($pIdCompte) . "'\n\t\t\tAND ope1." . OperationManager::CHAMP_OPERATION_TYPE_PAIEMENT . " in (3,4,9,10)\n\t\tORDER BY ope1." . OperationManager::CHAMP_OPERATION_DATE . " DESC;"; $lLogger->log("Execution de la requete : " . $lRequete, PEAR_LOG_DEBUG); // Maj des logs $lSql = Dbutils::executerRequete($lRequete); $lListeCompteListeVirement = array(); if (mysql_num_rows($lSql) > 0) { while ($lLigne = mysql_fetch_assoc($lSql)) { array_push($lListeCompteListeVirement, OperationManager::remplirListeVirementCompte($lLigne[OperationManager::CHAMP_OPERATION_ID], $lLigne[OperationManager::CHAMP_OPERATION_DATE], $lLigne[CompteManager::CHAMP_COMPTE_LABEL], $lLigne[OperationManager::CHAMP_OPERATION_MONTANT], $lLigne[OperationManager::CHAMP_OPERATION_TYPE_PAIEMENT])); } } else { $lListeCompteListeVirement[0] = new CompteListeVirementVO(); } return $lListeCompteListeVirement; }