You are here

function faqfield_property_info_callback in FAQ Field 7

Additional callback to adapt the property info of faqfields.

See also

entity_metadata_field_entity_property_info().

1 string reference to 'faqfield_property_info_callback'
faqfield_field_info in ./faqfield.module
Implements hook_field_info().

File

./faqfield.module, line 62
FAQ Field Provides a field for frequently asked questions.

Code

function faqfield_property_info_callback(&$info, $entity_type, $field, $instance, $field_type) {
  $property =& $info[$entity_type]['bundles'][$instance['bundle']]['properties'][$field['field_name']];

  // Define a data structure so it's possible to deal with both
  // the question and answer.
  $property['getter callback'] = 'entity_metadata_field_verbatim_get';
  $property['setter callback'] = 'entity_metadata_field_verbatim_set';

  // Auto-create the field item as soon as a property is set.
  $property['auto creation'] = 'faqfield_item_create';
  $property['property info'] = faqfield_item_property_info();
  unset($property['query callback']);
}