예제 #1
0
 /**
  * @param Customer $customer
  */
 public function fromUser(Customer $customer)
 {
     $this->title = $customer->getTitle() ? $customer->getTitle()->getId() : '';
     $this->lastName = $customer->getLastName();
     $this->firstName = $customer->getFirstName();
     $this->phone = $customer->getPhone();
     $this->email = $customer->getEmail();
     $this->address = $customer->getAddress();
     $this->address2 = $customer->getAddress2();
     $this->zipCode = $customer->getZipCode();
     $this->city = $customer->getCity();
     $this->country = $customer->getCountry();
     $this->locale = $customer->getLocale();
     $this->birthDate = $customer->getBirthDate();
 }
예제 #2
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;
 }