function brightcove_entity_info in Brightcove Video Connect 7.6
Same name and namespace in other branches
- 7.7 brightcove.module \brightcove_entity_info()
Implements hook_entity_info().
File
- ./
brightcove.module, line 1985 - Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.
Code
function brightcove_entity_info() {
$entity_info = [];
$entity_info['brightcove_client'] = [
'label' => t('API Client'),
'base table' => 'brightcove_client',
'uri callback' => 'brightcove_client_uri',
'controller class' => 'BrightcoveClientEntityController',
'exportable' => TRUE,
'entity class' => 'Entity',
'entity keys' => [
'id' => 'bcid',
'label' => 'label',
'name' => 'client_id',
],
'admin ui' => [
'path' => 'admin/config/media/brightcove/client',
'controller class' => 'BrightcoveClientEntityUIController',
'file' => 'brightcove.client.inc',
],
'module' => 'brightcove',
'access callback' => 'brightcove_client_access',
'permission labels' => [
'singular' => t('client'),
'plural' => t('clients'),
],
];
$entity_info['brightcove_playlist'] = [
'label' => t('Brightcove playlist'),
// We don't store playlists locally.
'base table' => NULL,
'controller class' => 'BrightcovePlaylistEntityController',
'entity class' => 'Entity',
'entity keys' => [
'id' => 'bpid',
'label' => 'label',
'bundle' => 'type',
],
'bundle keys' => [
'bundle' => 'type',
],
'admin ui' => [
'path' => 'admin/config/media/brightcove/playlist',
'controller class' => 'BrightcovePlaylistEntityUIController',
'file' => 'brightcove.playlist.inc',
'menu wildcard' => '%brightcove_playlist',
],
'module' => 'brightcove',
'access callback' => 'brightcove_playlist_access',
'permission labels' => [
'singular' => t('playlist'),
'plural' => t('playlists'),
],
'load hook' => 'brightcove_playlist_load',
'bundles' => [
BRIGHTCOVE_PLAYLIST_TYPE_MANUAL => [
'label' => t('Manual playlist'),
],
BRIGHTCOVE_PLAYLIST_TYPE_SMART => [
'label' => t('Smart playlist'),
],
],
];
$entity_info['brightcove_video'] = [
'label' => t('Brightcove video'),
'fieldable' => TRUE,
'base table' => 'brightcove_video',
'controller class' => 'BrightcoveVideoEntityController',
'entity class' => 'Entity',
'entity keys' => [
'id' => 'bvid',
'bundle' => 'type',
'label' => 'label',
],
'bundle keys' => [
'bundle' => 'type',
],
'module' => 'brightcove',
'permission labels' => [
'singular' => t('video'),
'plural' => t('videos'),
],
'form callback' => 'brightcove_video_form',
'access callback' => 'brightcove_video_access',
'bundles' => [
'brightcove_video' => [
'label' => t('Brightcove video'),
'admin' => [
'path' => 'admin/config/media/brightcove/additional-fields',
'real path' => 'admin/config/media/brightcove/additional-fields',
],
],
],
'load hook' => 'brightcove_video_load',
];
return $entity_info;
}