Ejemplo n.º 1
0
 protected function customerToArray(Customer $customer)
 {
     $toReturn = array();
     $mainAccentCard = $customer->getMainAccentCard();
     $toReturn['numC'] = $mainAccentCard ? $mainAccentCard->getNumber() : '';
     $toReturn['nom'] = $customer->getLastName();
     $toReturn['prenom'] = $customer->getFirstName();
     $toReturn['telephone'] = $customer->getPhone();
     $toReturn['mobile'] = $customer->getMobile() ?: '';
     $toReturn['email'] = $customer->getEmail();
     $toReturn['adresse'] = $customer->getAddress();
     $toReturn['cplAdresse'] = $customer->getAddress2() ?: '';
     $toReturn['codePostal'] = $customer->getZipCode();
     $toReturn['ville'] = $customer->getCity();
     $toReturn['pays'] = $customer->getCountry();
     $toReturn['langue'] = $customer->getLocale();
     $toReturn['civilite'] = $customer->getGalittTitle() ?: $customer->getTitle()->getGalittTitle()->getValue();
     $toReturn['nlCarteFidelite'] = $customer->getAccountOption() ? $customer->getAccountOption() : 'O';
     $toReturn['dateNaissance'] = $customer->getBirthDate() ? $customer->getBirthDate()->format('Ymd') : '19700101';
     return $toReturn;
 }