You are here

function term_level_entity_metadata_callback in Term Level Field 7

Entity metadata callback for term_level settings.

1 string reference to 'term_level_entity_metadata_callback'
term_level_field_info in ./term_level.module
Implements hook_field_info().

File

./term_level.module, line 41
Field type for referencing terms with a level to an entity.

Code

function term_level_entity_metadata_callback(&$info, $entity_type, $field, $instance, $field_type) {
  $property =& $info[$entity_type]['bundles'][$instance['bundle']]['properties'][$field['field_name']];
  $property['getter callback'] = 'entity_metadata_field_verbatim_get';
  $property['setter callback'] = 'entity_metadata_field_verbatim_set';
  unset($property['query callback']);
  $property['property info'] = array(
    'term' => array(
      'type' => 'taxonomy_term',
      'label' => t('Taxonomy Term'),
      'getter callback' => 'term_level_entity_metadata_field_get_term',
    ),
    'level' => array(
      'type' => 'integer',
      'label' => t('Level'),
    ),
  );
  $property['options list'] = 'entity_metadata_field_options_list';
}