You are here

function _rdf_mapping_load_multiple in Drupal 7

Helper function to retrieve a set of RDF mappings from the database.

Parameters

$type: The entity type of the mappings.

$bundles: The bundles the mappings refer to.

Return value

An array of RDF mapping structures, or an empty array.

2 calls to _rdf_mapping_load_multiple()
rdf_entity_info_alter in modules/rdf/rdf.module
Implements hook_entity_info_alter().
_rdf_mapping_load in modules/rdf/rdf.module
Helper function to retrieve an RDF mapping from the database.

File

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

Code

function _rdf_mapping_load_multiple($type, array $bundles) {
  $mappings = db_select('rdf_mapping')
    ->fields(NULL, array(
    'bundle',
    'mapping',
  ))
    ->condition('type', $type)
    ->condition('bundle', $bundles)
    ->execute()
    ->fetchAllKeyed();
  foreach ($mappings as $bundle => $mapping) {
    $mappings[$bundle] = unserialize($mapping);
  }
  return $mappings;
}