You are here

function fraction_data_property_info in Fraction 7

Defines info for the properties of the fraction field data structure.

1 call to fraction_data_property_info()
fraction_property_info_callback in ./fraction.field.inc
Callback to alter the property info of fraction fields.

File

./fraction.field.inc, line 53
Fraction Field API functions

Code

function fraction_data_property_info($name = NULL) {

  // Build an array of basic property information for the fraction field.
  $properties = array(
    'numerator' => array(
      'label' => t('Numerator'),
    ),
    'denominator' => array(
      'label' => t('Denominator'),
    ),
  );
  foreach ($properties as &$property) {
    $property += array(
      'type' => 'integer',
      'description' => !empty($name) ? t('!label of field %name', array(
        '!label' => $property['label'],
        '%name' => $name,
      )) : '',
      'getter callback' => 'entity_property_verbatim_get',
      'setter callback' => 'entity_property_verbatim_set',
    );
  }
  return $properties;
}