You are here

function matrix_field_property_info_callback in Matrix field 8.2

Same name and namespace in other branches
  1. 7.2 matrix.module \matrix_field_property_info_callback()

Additional callback to adapt the property info of matrix fields.

See also

entity_metadata_field_entity_property_info()

1 string reference to 'matrix_field_property_info_callback'
matrix_field_info in ./matrix.module
Implements hook_field_info().

File

./matrix.module, line 991
Contains matrix.module.

Code

function matrix_field_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 the row, column and
  // value.
  $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'] = 'matrix_field_item_create';
  $property['property info'] = matrix_field_item_property_info();
  unset($property['query callback']);
}