You are here

function _xmlsitemap_table_data in XML sitemap 7.2

Table information.

Parameters

array $info: Information about how the entity type is represented by xmlsitemap.

Return value

array An array of table data based on the information about the entity type. Most importantly it returns join data for the table alias, which is different each time.

1 call to _xmlsitemap_table_data()
xmlsitemap_views_data in ./xmlsitemap.views.inc
Implements hook_views_data().

File

./xmlsitemap.views.inc, line 42
Provides information about the data being made available for views.

Code

function _xmlsitemap_table_data(array $info) {
  $table_data = array();
  $table_data['group'] = t('XML sitemap');

  // Gets the base table (node, user, etc.) from $info.
  $table_data['join'][$info['base table']] = array(
    'table' => 'xmlsitemap',
    'field' => 'id',
    // Gets the field name (nid, uid, etc.) from $info.
    'left_field' => $info['entity keys']['id'],
    'extra' => array(
      array(
        'field' => 'type',
        // Also filters on the entity type (node, user, etc.),
        // not to be confused with the base table name above.
        'value' => $info['type'],
        'operator' => '=',
      ),
    ),
  );
  return $table_data;
}