Esempio n. 1
0
 /**
  * Adds the customer and address data to the given customer item
  *
  * @param MShop_Customer_Item_Interface $customer Customer object
  * @param MShop_Common_Item_Address_Interface $address Billing address object
  * @return MShop_Customer_Item_Interface Customer object filled with data
  */
 protected function _addCustomerData(MShop_Customer_Item_Interface $customer, MShop_Common_Item_Address_Interface $address)
 {
     $password = substr(md5(microtime(true) . rand()), -8);
     $label = $address->getLastname();
     if (($part = $address->getFirstname()) !== '') {
         $label = $part . ' ' . $label;
     }
     if (($part = $address->getCompany()) !== '') {
         $label .= ' (' . $part . ')';
     }
     $customer->setPaymentAddress($address);
     $customer->setCode($address->getEmail());
     $customer->setPassword($password);
     $customer->setLabel($label);
     $customer->setStatus(1);
     return $customer;
 }
Esempio n. 2
0
 /**
  * Copys all data from a given address.
  *
  * @param MShop_Common_Item_Address_Interface $address New address
  */
 public function copyFrom(MShop_Common_Item_Address_Interface $address)
 {
     $this->setAddressId($address->getId());
     $this->setCompany($address->getCompany());
     $this->setVatID($address->getVatID());
     $this->setSalutation($address->getSalutation());
     $this->setTitle($address->getTitle());
     $this->setFirstname($address->getFirstname());
     $this->setLastname($address->getLastname());
     $this->setAddress1($address->getAddress1());
     $this->setAddress2($address->getAddress2());
     $this->setAddress3($address->getAddress3());
     $this->setPostal($address->getPostal());
     $this->setCity($address->getCity());
     $this->setState($address->getState());
     $this->setCountryId($address->getCountryId());
     $this->setTelephone($address->getTelephone());
     $this->setEmail($address->getEmail());
     $this->setTelefax($address->getTelefax());
     $this->setWebsite($address->getWebsite());
     $this->setLanguageId($address->getLanguageId());
     $this->setFlag($address->getFlag());
     $this->setModified();
 }