Пример #1
0
 public function jsonSerialize()
 {
     $email = $this->findCoordonnee('email');
     $telephone = $this->findCoordonnee('phone');
     $adresse = $this->findCoordonnee('address');
     $adresseValue = $adresse ? $adresse->getCoordonnee() : null;
     $adresseTokens = $adresseValue ? explode("\n", $adresseValue->address) : [];
     while (count($adresseTokens) < 3) {
         array_push($adresseTokens, null);
     }
     return ['id' => $this->getIdMembre(), 'numero' => $this->getIdAncienSi(), 'nom' => $this->getNom(), 'prenom' => $this->getPrenom(), 'statut' => $this->getStatut(), 'enfants' => $this->getEnfants(), 'civilite' => $this->getCivilite(), 'genre' => $this->getGenre(), 'region' => $this->getRegion(), 'devise' => $this->getDevise(), 'dateNaissance' => Format::date($this->getDateNaissance()), 'dateInscription' => Format::date($this->getDateInscription()), 'email' => $email ? $email->getCoordonnee() : null, 'emailPrive' => $email ? $email->getReserveeGestionAsso() : null, 'telephone' => $telephone ? $telephone->getCoordonnee() : null, 'telephonePrive' => $telephone ? $telephone->getReserveeGestionAsso() : null, 'adressePrivee' => $adresse ? $adresse->getReserveeGestionAsso() : null, 'adresse1' => $adresseTokens[0], 'adresse2' => $adresseTokens[1], 'adresse3' => $adresseTokens[2], 'ville' => $adresseValue ? $adresseValue->city : null, 'codePostal' => $adresseValue ? $adresseValue->code : null, 'pays' => $adresseValue ? $adresseValue->country : null, 'langues' => $this->getLangues(), 'competences' => $this->getCompetences(), 'passions' => $this->getPassions()];
 }