You are here

function rdf_mapping_load in Drupal 7

Returns the mapping for attributes of a given entity type/bundle pair.

Parameters

$type: An entity type.

$bundle: (optional) A bundle name.

Return value

The mapping corresponding to the requested entity type/bundle pair or an empty array.

Related topics

7 calls to rdf_mapping_load()
RdfMappingHookTestCase::testMapping in modules/rdf/rdf.test
Test that hook_rdf_mapping() correctly returns and processes mapping.
RdfRdfaMarkupTestCase::testAttributesInMarkupFile in modules/rdf/rdf.test
Ensure that file fields have the correct resource as the object in RDFa when displayed as a teaser.
RdfRdfaMarkupTestCase::testDrupalRdfaAttributes in modules/rdf/rdf.test
Test rdf_rdfa_attributes().
rdf_entity_load in modules/rdf/rdf.module
Implements hook_entity_load().
rdf_preprocess_field in modules/rdf/rdf.module
Implements MODULE_preprocess_HOOK().

... See full list

1 string reference to 'rdf_mapping_load'
tracker_page in modules/tracker/tracker.pages.inc
Page callback: prints a listing of active nodes on the site.

File

modules/rdf/rdf.module, line 133
Enables semantically enriched output for Drupal sites in the form of RDFa.

Code

function rdf_mapping_load($type, $bundle = RDF_DEFAULT_BUNDLE) {

  // Retrieves the bundle-specific mapping from the entity info.
  $entity_info = entity_get_info($type);
  if (!empty($entity_info['bundles'][$bundle]['rdf_mapping'])) {
    return $entity_info['bundles'][$bundle]['rdf_mapping'];
  }
  else {
    return _rdf_get_default_mapping($type);
  }
}