original_string: protected function addAddressCheckout($type)
      {
          $submitted = $this->getSubmitted("address.$type");
  
          if ($this->{"show_{$type}_address_form"} && !empty($submitted)) {
  
              $address_id = $this->address->add($submitted);
              $this->setSubmitted("{$type}_address", $address_id);
  
              foreach ($this->address->getExceeded($this->order_user_id) as $address) {
                  $this->address->delete($address['address_id']);
              }
          }
      }
code: protected function addAddressCheckout($type)
      {
          $submitted = $this->getSubmitted("address.$type");
  
          if ($this->{"show_{$type}_address_form"} && !empty($submitted)) {
  
              $address_id = $this->address->add($submitted);
              $this->setSubmitted("{$type}_address", $address_id);
  
              foreach ($this->address->getExceeded($this->order_user_id) as $address) {
                  $this->address->delete($address['address_id']);
              }
          }
      }
code_tokens: protected function addAddressCheckout ( $ type ) { $ submitted = $ this -> getSubmitted ( "address.$type" ) ; if ( $ this -> { "show_{$type}_address_form" } && ! empty ( $ submitted ) ) { $ address_id = $ this -> address -> add ( $ submitted ) ; $ this -> setSubmitted ( "{$type}_address" , $ address_id ) ; foreach ( $ this -> address -> getExceeded ( $ this -> order_user_id ) as $ address ) { $ this -> address -> delete ( $ address [ 'address_id' ] ) ; } } }
docstring: Adds a submitted address
  @param string $type
docstring_tokens: Adds a submitted address