You are here

function _microdata_get_field_properties in Microdata 7

Get the field's properties.

Parameters

string $entity_type: The entity type that the field is attached to.

string $bundle_type: The bundle that the field is attached to.

string $field_name: The field's name.

Return value

array An array of property info for the field's microdata-enabled properties.

5 calls to _microdata_get_field_properties()
microdata_form_field_ui_field_edit_form_alter in includes/microdata.form_alter.inc
Implements hook_form_FORM_ID_alter().
microdata_form_field_ui_field_edit_form_submit in includes/microdata.form_alter.inc
Submit callback; saves field mapping in both UIs.
microdata_get_instance_mapping_form in ./microdata.admin.inc
Form builder helper function.
_microdata_mapping_add_defaults in ./microdata.module
Helper function.
_microdata_prepare_mapping in ./microdata.module
Helper function to prepare a microdata mapping for use.

File

./microdata.module, line 1073

Code

function _microdata_get_field_properties($entity_type, $bundle_type, $field_name) {
  $property_info = entity_get_property_info($entity_type);
  if (isset($property_info['bundles'][$bundle_type]['properties'][$field_name]['property info'])) {
    $properties = $property_info['bundles'][$bundle_type]['properties'][$field_name]['property info'];

    // Remove properties that are not microdata enabled.
    foreach ($properties as $key => $property) {
      if (!microdata_enabled($property)) {
        unset($properties[$key]);
      }
    }
    return $properties;
  }
  return array();
}