id = $id; $this->nomPrenom = $nomPrenom; $this->adresse = $adresse; $this->codePostal = $codePostal; $this->ville = $ville; $this->courriel = $courriel; $this->versements = array(); // clé = tarif, valeur = montant } /** * return copie d'une personne */ public function clone() { return new Personne( $this->id, $this->nomPrenom, $this->adresse, $this->codePostal, $this->ville, $this->courriel); } /** * ajouter un versement * @param $tauxReduction * @param $montant */ public function ajouterVersement( $tauxReduction, $montant ) { if (array_key_exists($tauxReduction, $this->versements)) { $this->versements[$tauxReduction] += $montant; } else { $this->versements[$tauxReduction] = $montant; } } }