_rdf_get_default_mapping

Versions
mediamosa-21
_rdf_get_default_mapping($type)

Returns the default RDF mapping for a given entity type.

Parameters

$type An entity type, e.g. 'node' or 'comment'.

Return value

The RDF mapping or an empty array if no mapping is defined for this entity type.

▾ 3 functions call _rdf_get_default_mapping()

rdf_entity_info_alter in modules/rdf/rdf.module
Implements hook_entity_info_alter().
rdf_mapping_load in modules/rdf/rdf.module
Returns the mapping for attributes of a given type/bundle pair.
rdf_mapping_save in modules/rdf/rdf.module
Saves an RDF mapping to the database.

Code

modules/rdf/rdf.module, line 135

<?php
function _rdf_get_default_mapping($type) {
  $default_mappings = &drupal_static(__FUNCTION__);

  if (!isset($default_mappings)) {
    // Get all modules implementing hook_rdf_mapping().
    $modules = module_implements('rdf_mapping');

    // Only consider the default entity mapping definitions.
    foreach ($modules as $module) {
      $mappings = module_invoke($module, 'rdf_mapping');
      foreach ($mappings as $mapping) {
        if ($mapping['bundle'] === RDF_DEFAULT_BUNDLE) {
          $default_mappings[$mapping['type']] = $mapping['mapping'];
        }
      }
    }
  }

  return isset($default_mappings[$type]) ? $default_mappings[$type] : array();
}
?>