You are here

function addressfield_phone_data_property_info in Address Field Phone 7

Defines additional properties of the addressfield data structure.

1 call to addressfield_phone_data_property_info()
addressfield_phone_property_info_callback in ./addressfield_phone.module
Callback to alter the property info of addressfield.

File

./addressfield_phone.module, line 41
Add additional phone fields to addressfield.

Code

function addressfield_phone_data_property_info($name = NULL) {

  // Build an array of basic property information for the addressfield.
  $properties = array(
    'phone_number' => array(
      'label' => t('Phone number'),
    ),
    'phone_number_extension' => array(
      'label' => t('Phone extension'),
    ),
    'mobile_number' => array(
      'label' => t('Mobile number'),
    ),
    'fax_number' => array(
      'label' => t('Fax number'),
    ),
  );

  // Add the default values for each of the address field phone properties.
  foreach ($properties as $key => &$value) {
    $value += array(
      'description' => $name ? t('!label of field %name', array(
        '!label' => $value['label'],
        '%name' => $name,
      )) : '',
      'type' => 'text',
      'getter callback' => 'entity_property_verbatim_get',
      'setter callback' => 'entity_property_verbatim_set',
    );
  }
  return $properties;
}