/**
  * Removes an address from this address book.
  *
  * This method is called when an address is deleted
  * or when the owner of an address is set.
  *
  * @param UcAddressesAddress $address
  *   The address to remove from the address book.
  *
  * @access private
  * @return void
  */
 private function removeAddressFromAddressBook($address)
 {
     $aid = $address->getId();
     if (isset($this->addresses[$aid])) {
         unset($this->addresses[$address->getId()]);
     }
     // Check default addresses array
     foreach ($this->defaultAddresses as $address_type => $defaultAddress) {
         if ($defaultAddress->getId() == $aid) {
             unset($this->defaultAddresses[$address_type]);
         }
     }
 }
/**
 * This hook allows you to respond to address deletion.
 *
 * @param UcAddressesAddress $address
 *   The address object.
 *
 * @return void
 */
function hook_uc_addresses_address_delete($address)
{
    // Example: delete the value from my table.
    db_delete('mydbtable')->condition('aid', $address->getId())->execute();
}