/**
  * Output a field's value.
  *
  * @param mixed $value
  *   The value to output.
  * @param string $format
  *   The format in which the value should be outputted.
  *   Possible formats are declared by field handlers: getOutputFormats().
  *
  * @access public
  * @return string
  *   The field's value safe for output.
  * @see getOutputFormats()
  */
 public function outputValue($value = '', $format = '')
 {
     if ($value === '') {
         $value = $this->address->getField($this->name);
     }
     return check_plain($value);
 }
/**
 * This hook allows you to respond to updates to an address.
 *
 * @param UcAddressesAddress $address
 *   The address object.
 *
 * @return void
 */
function hook_uc_addresses_address_update($address)
{
    // Example: get the value of my custom field and update it in my own table.
    $record = array('aid' => $address->getId(), 'myfield' => $address->getField('myfield'));
    drupal_write_record('mydbtable', $record, array('aid'));
}