/** * @name convertFromArray($pArray) * @param array() * @desc Convertit le array en objet AchatVO */ public static function convertFromArray($pArray) { if (isset($pArray['operationAchat'])) { $lOperationAchat = OperationDetailToVO::convertFromArray($pArray['operationAchat']); } else { $lOperationAchat = NULL; } if (isset($pArray['operationAchatSolidaire'])) { $lOperationAchatSolidaire = OperationDetailToVO::convertFromArray($pArray['operationAchatSolidaire']); } else { $lOperationAchatSolidaire = NULL; } if (isset($pArray['produits'])) { $lProduits = array(); foreach ($pArray['produits'] as $lProduit) { if (!is_null($lProduit)) { array_push($lProduits, ProduitDetailAchatToVO::convertFromArray($lProduit)); } } } else { $lProduits = NULL; } if (isset($pArray['rechargement'])) { $lRechargement = OperationDetailToVO::convertFromArray($pArray['rechargement']); } else { $lRechargement = NULL; } return new AchatVO($lOperationAchat, $lOperationAchatSolidaire, $lProduits, $lRechargement); }
/** * @name convertFromArray($pArray) * @param array() * @desc Convertit le array en objet FactureVO */ public static function convertFromArray($pArray) { if (isset($pArray['id'])) { $lId = OperationDetailToVO::convertFromArray($pArray['id']); } else { $lId = NULL; } if (isset($pArray['operationProducteur'])) { $lOperationProducteur = OperationDetailToVO::convertFromArray($pArray['operationProducteur']); } else { $lOperationProducteur = NULL; } if (isset($pArray['operationZeybu'])) { $lOperationZeybu = OperationDetailToVO::convertFromArray($pArray['operationZeybu']); } else { $lOperationZeybu = NULL; } if (isset($pArray['produits'])) { $lProduits = array(); foreach ($pArray['produits'] as $lProduit) { if (!is_null($lProduit)) { array_push($lProduits, ProduitDetailFactureToVO::convertFromArray($lProduit)); } } } else { $lProduits = NULL; } return new FactureVO($lId, $lOperationProducteur, $lOperationZeybu, $lProduits); }
/** * @name convertFromArray($pArray) * @param array() * @desc Convertit le array en objet RemiseChequeDetailVO */ public static function convertFromArray($pArray) { if (isset($pArray['id'])) { $lId = $pArray['id']; } else { $lId = NULL; } if (isset($pArray['numero'])) { $lNumero = $pArray['numero']; } else { $lNumero = NULL; } if (isset($pArray['idCompte'])) { $lIdCompte = $pArray['idCompte']; } else { $lIdCompte = NULL; } if (isset($pArray['montant'])) { $lMontant = $pArray['montant']; } else { $lMontant = NULL; } if (isset($pArray['operations']) && is_array($pArray['operations'])) { $lOperations = array(); foreach ($pArray['operations'] as $lOperation) { array_push($lOperations, OperationDetailToVO::convertFromArray($lOperation)); } } else { $lOperations = NULL; } return new RemiseChequeDetailVO($lId, $lNumero, $lIdCompte, $lMontant, $lOperations); }
/** * @name rechargerCompte($pParam) * @return VR * @desc Recharge le compte d'un adhérent */ public function rechargerCompte($pParam) { $lVr = RechargementCompteValid::validAjout($pParam); if ($lVr->getValid()) { $lOperationService = new OperationService(); $lOperationService->set(OperationDetailToVO::convertFromArray($pParam)); } return $lVr; }
/** * @name convertFromArray($pArray) * @param array() * @desc Convertit le array en objet AdhesionAdherentDetailVO */ public static function convertFromArray($pArray) { if (isset($pArray['adhesionAdherent'])) { $lAdhestionAdherent = AdhesionAdherentToVO::convertFromArray($pArray['adhesionAdherent']); } else { $lAdhestionAdherent = NULL; } if (isset($pArray['operation'])) { $lOperation = OperationDetailToVO::convertFromArray($pArray['operation']); } else { $lOperation = NULL; } return new AdhesionAdherentDetailVO($lAdhestionAdherent, $lOperation, null); }
/** * @name ajoutOperation($pParam) * @return OperationDetailVR * @desc Ajoute une operation au compte association */ public function ajoutOperation($pParam) { $lVr = CompteAssociationValid::validAjoutOperation($pParam); if ($lVr->getValid()) { $lOperationService = new OperationService(); $lOperation = OperationDetailToVO::convertFromArray($pParam); $lOperation->setIdCompte(-4); // Le Compte Association $lOperationService->set($lOperation); } return $lVr; }