You are here

function photos_access_views_data in Album Photos 8.4

Same name and namespace in other branches
  1. 8.5 photos_access/photos_access.module \photos_access_views_data()
  2. 7.3 photos_access/photos_access.module \photos_access_views_data()
  3. 6.0.x photos_access/photos_access.module \photos_access_views_data()

Implements hook_views_data().

File

photos_access/photos_access.module, line 963
Implementation of photos_access.module.

Code

function photos_access_views_data() {
  $data = [];
  $data['photos_access_album'] = [];
  $data['photos_access_album']['table'] = [];
  $data['photos_access_album']['table']['group'] = t('Photos');
  $data['photos_access_album']['table']['provider'] = 'photos_access';

  // Join node_field_data.
  $data['photos_access_album']['table']['join'] = [
    'node_field_data' => [
      'left_field' => 'nid',
      'field' => 'nid',
    ],
  ];

  // Numeric field, exposed as a field, sort, filter, and argument.
  $data['photos_access_album']['viewid'] = [
    'title' => t('Privacy'),
    'help' => t('Album privacy setting.'),
    'field' => [
      'id' => 'numeric',
    ],
    'sort' => [
      'id' => 'standard',
    ],
    'filter' => [
      'id' => 'in_operator',
      'options callback' => '_photos_access_album_views_options',
    ],
    'argument' => [
      'id' => 'numeric',
    ],
  ];
  return $data;
}