getType() public method

public getType ( ) : integer
return integer Address' type
Example #1
0
 /**
  * {@inheritdoc}
  */
 public function setCurrent(AddressInterface $address)
 {
     foreach ($address->getCustomer()->getAddressesByType($address->getType()) as $custAddress) {
         if ($custAddress->getCurrent()) {
             $custAddress->setCurrent(false);
             $this->save($custAddress);
             break;
         }
     }
     $address->setCurrent(true);
     $this->save($address);
 }
 /**
  * {@inheritdoc}
  */
 public function addAddress(AddressInterface $address)
 {
     $address->setCustomer($this);
     if (count($this->getAddressesByType($address->getType())) === 0) {
         $address->setCurrent(true);
     }
     $this->getAddresses()->add($address);
     if (null === $this->getFirstname()) {
         $this->setFirstname($address->getFirstname());
     }
     if (null === $this->getLastname()) {
         $this->setLastname($address->getLastname());
     }
     if (null === $this->getPhoneNumber()) {
         $this->setPhoneNumber($address->getPhone());
     }
 }