本文整理汇总了PHP中Drupal\views\EntityViewsData类的典型用法代码示例。如果您正苦于以下问题:PHP EntityViewsData类的具体用法?PHP EntityViewsData怎么用?PHP EntityViewsData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EntityViewsData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
$data['block_content_field_data']['id']['field']['id'] = 'field';
$data['block_content_field_data']['info']['field']['id'] = 'field';
$data['block_content_field_data']['info']['field']['link_to_entity default'] = TRUE;
$data['block_content_field_data']['type']['field']['id'] = 'field';
// @todo Figure out the way to integrate this automatic in
// content_translation https://www.drupal.org/node/2410261.
if ($this->moduleHandler->moduleExists('content_translation')) {
$data['block_content']['translation_link'] = array('title' => $this->t('Translation link'), 'help' => $this->t('Provide a link to the translations overview for custom blocks.'), 'field' => array('id' => 'content_translation_link'));
}
// Advertise this table as a possible base table.
$data['block_content_revision']['table']['base']['help'] = $this->t('Block Content revision is a history of changes to block content.');
$data['block_content_revision']['table']['base']['defaults']['title'] = 'info';
// @todo EntityViewsData should add these relationships by default.
// https://www.drupal.org/node/2410275
$data['block_content_revision']['id']['relationship']['id'] = 'standard';
$data['block_content_revision']['id']['relationship']['base'] = 'block_content';
$data['block_content_revision']['id']['relationship']['base field'] = 'id';
$data['block_content_revision']['id']['relationship']['title'] = $this->t('Block Content');
$data['block_content_revision']['id']['relationship']['label'] = $this->t('Get the actual block content from a block content revision.');
$data['block_content_revision']['revision_id']['relationship']['id'] = 'standard';
$data['block_content_revision']['revision_id']['relationship']['base'] = 'block_content';
$data['block_content_revision']['revision_id']['relationship']['base field'] = 'revision_id';
$data['block_content_revision']['revision_id']['relationship']['title'] = $this->t('Block Content');
$data['block_content_revision']['revision_id']['relationship']['label'] = $this->t('Get the actual block content from a block content revision.');
$data['block_content_revision']['revision_log']['field']['id'] = 'xss';
return $data;
}
示例2: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
$data['block_content_field_data']['id']['field']['id'] = 'field';
$data['block_content_field_data']['info']['field']['id'] = 'field';
$data['block_content_field_data']['info']['field']['link_to_entity default'] = TRUE;
$data['block_content_field_data']['type']['field']['id'] = 'field';
$data['block_content']['block_content_listing_empty'] = array('title' => $this->t('Empty block library behavior'), 'help' => $this->t('Provides a link to add a new block.'), 'area' => array('id' => 'block_content_listing_empty'));
// Advertise this table as a possible base table.
$data['block_content_field_revision']['table']['base']['help'] = $this->t('Block Content revision is a history of changes to block content.');
$data['block_content_field_revision']['table']['base']['defaults']['title'] = 'info';
// @todo EntityViewsData should add these relationships by default.
// https://www.drupal.org/node/2410275
$data['block_content_field_revision']['id']['relationship']['id'] = 'standard';
$data['block_content_field_revision']['id']['relationship']['base'] = 'block_content_field_data';
$data['block_content_field_revision']['id']['relationship']['base field'] = 'id';
$data['block_content_field_revision']['id']['relationship']['title'] = $this->t('Block Content');
$data['block_content_field_revision']['id']['relationship']['label'] = $this->t('Get the actual block content from a block content revision.');
$data['block_content_field_revision']['revision_id']['relationship']['id'] = 'standard';
$data['block_content_field_revision']['revision_id']['relationship']['base'] = 'block_content_field_data';
$data['block_content_field_revision']['revision_id']['relationship']['base field'] = 'revision_id';
$data['block_content_field_revision']['revision_id']['relationship']['title'] = $this->t('Block Content');
$data['block_content_field_revision']['revision_id']['relationship']['label'] = $this->t('Get the actual block content from a block content revision.');
return $data;
}
示例3: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
$data['media_field_data']['table']['wizard_id'] = 'media';
$data['media_field_revision']['table']['wizard_id'] = 'media_revision';
return $data;
}
示例4: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
$data['card_base']['card_base_bulk_form'] = array('title' => t('Bulk update'), 'help' => t('Add a form element that lets you run operations on multiple card bases.'), 'field' => array('id' => 'card_base_bulk_form'));
$data['card_base']['card_base_instance_count'] = array('title' => t('Count instances'), 'help' => t('Displays a count of card instances of this card base.'), 'field' => array('id' => 'card_base_instance_count'));
return $data;
}
示例5: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
// @todo D8-port: Add some data from D7 function workflow_views_views_data_alter() ??
// @see http://cgit.drupalcode.org/workflow/tree/workflow_views/workflow_views.views.inc
return $data;
}
示例6: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
$data['tmgmt_local_task_item']['status'] = array('title' => t('Status'), 'help' => t('Display the status of the task item.'), 'field' => array('id' => 'tmgmt_local_task_item_status'));
$data['tmgmt_local_task_item']['progress'] = array('title' => t('Progress'), 'help' => t('Displays the progress of a task item.'), 'real field' => 'tltiid', 'field' => array('id' => 'tmgmt_local_progress'));
$data['tmgmt_local_task_item']['word_count'] = array('title' => t('Words'), 'help' => t('Displays the word count of a task item.'), 'real field' => 'tltiid', 'field' => array('id' => 'tmgmt_local_wordcount'));
return $data;
}
示例7: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = parent::getViewsData();
$data['fillpdf_fields']['table']['group'] = $data['fillpdf_fields']['table']['base']['title'] = t('FillPDF form fields');
$data['fillpdf_fields']['table']['base']['help'] = t('FillPDF form fields represent fields in an uploaded FillPDF PDF.');
return $data;
}
示例8: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$views_data = parent::getViewsData();
if ($this->entityType->id() != 'entity_test') {
return $views_data;
}
$views_data = NestedArray::mergeDeep($views_data, \Drupal::state()->get('entity_test.views_data', []));
return $views_data;
}
示例9: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
$data['users_field_data']['table']['base']['help'] = t('Users who have created accounts on your site.');
$data['users_field_data']['table']['base']['access query tag'] = 'user_access';
$data['users_field_data']['table']['wizard_id'] = 'user';
$data['users_field_data']['uid']['field']['id'] = 'user';
$data['users_field_data']['uid']['argument']['id'] = 'user_uid';
$data['users_field_data']['uid']['argument'] += array('name table' => 'users_field_data', 'name field' => 'name', 'empty field name' => \Drupal::config('user.settings')->get('anonymous'));
$data['users_field_data']['uid']['filter']['id'] = 'user_name';
$data['users_field_data']['uid']['filter']['title'] = t('Name');
$data['users_field_data']['uid']['relationship'] = array('title' => t('Content authored'), 'help' => t('Relate content to the user who created it. This relationship will create one record for each content item created by the user.'), 'id' => 'standard', 'base' => 'node_field_data', 'base field' => 'uid', 'field' => 'uid', 'label' => t('nodes'));
$data['users_field_data']['uid_raw'] = array('help' => t('The raw numeric user ID.'), 'real field' => 'uid', 'filter' => array('title' => t('The user ID'), 'id' => 'numeric'));
$data['users_field_data']['uid_representative'] = array('relationship' => array('title' => t('Representative node'), 'label' => t('Representative node'), 'help' => t('Obtains a single representative node for each user, according to a chosen sort criterion.'), 'id' => 'groupwise_max', 'relationship field' => 'uid', 'outer field' => 'users_field_data.uid', 'argument table' => 'users_field_data', 'argument field' => 'uid', 'base' => 'node_field_data', 'field' => 'nid', 'relationship' => 'node_field_data:uid'));
$data['users']['uid_current'] = array('real field' => 'uid', 'title' => t('Current'), 'help' => t('Filter the view to the currently logged in user.'), 'filter' => array('id' => 'user_current', 'type' => 'yes-no'));
$data['users_field_data']['name']['help'] = t('The user or author name.');
$data['users_field_data']['name']['field']['id'] = 'user_name';
$data['users_field_data']['name']['filter']['title'] = t('Name (raw)');
$data['users_field_data']['name']['filter']['help'] = t('The user or author name. This filter does not check if the user exists and allows partial matching. Does not use autocomplete.');
// Note that this field implements field level access control.
$data['users_field_data']['mail']['help'] = t('Email address for a given user. This field is normally not shown to users, so be cautious when using it.');
$data['users_field_data']['mail']['field']['id'] = 'user_mail';
$data['users_field_data']['langcode']['help'] = t('Original language of the user information');
$data['users_field_data']['langcode']['help'] = t('Language of the translation of user information');
$data['users_field_data']['preferred_langcode']['title'] = t('Preferred language');
$data['users_field_data']['preferred_langcode']['help'] = t('Preferred language of the user');
$data['users_field_data']['preferred_admin_langcode']['title'] = t('Preferred admin language');
$data['users_field_data']['preferred_admin_langcode']['help'] = t('Preferred administrative language of the user');
$data['users']['view_user'] = array('field' => array('title' => t('Link to user'), 'help' => t('Provide a simple link to the user.'), 'id' => 'user_link', 'click sortable' => FALSE));
$data['users_field_data']['created_fulldate'] = array('title' => t('Created date'), 'help' => t('Date in the form of CCYYMMDD.'), 'argument' => array('field' => 'created', 'id' => 'date_fulldate'));
$data['users_field_data']['created_year_month'] = array('title' => t('Created year + month'), 'help' => t('Date in the form of YYYYMM.'), 'argument' => array('field' => 'created', 'id' => 'date_year_month'));
$data['users_field_data']['created_year'] = array('title' => t('Created year'), 'help' => t('Date in the form of YYYY.'), 'argument' => array('field' => 'created', 'id' => 'date_year'));
$data['users_field_data']['created_month'] = array('title' => t('Created month'), 'help' => t('Date in the form of MM (01 - 12).'), 'argument' => array('field' => 'created', 'id' => 'date_month'));
$data['users_field_data']['created_day'] = array('title' => t('Created day'), 'help' => t('Date in the form of DD (01 - 31).'), 'argument' => array('field' => 'created', 'id' => 'date_day'));
$data['users_field_data']['created_week'] = array('title' => t('Created week'), 'help' => t('Date in the form of WW (01 - 53).'), 'argument' => array('field' => 'created', 'id' => 'date_week'));
$data['users_field_data']['status']['filter']['label'] = t('Active');
$data['users_field_data']['status']['filter']['type'] = 'yes-no';
$data['users_field_data']['changed']['title'] = t('Updated date');
$data['users_field_data']['changed_fulldate'] = array('title' => t('Updated date'), 'help' => t('Date in the form of CCYYMMDD.'), 'argument' => array('field' => 'changed', 'id' => 'date_fulldate'));
$data['users_field_data']['changed_year_month'] = array('title' => t('Updated year + month'), 'help' => t('Date in the form of YYYYMM.'), 'argument' => array('field' => 'changed', 'id' => 'date_year_month'));
$data['users_field_data']['changed_year'] = array('title' => t('Updated year'), 'help' => t('Date in the form of YYYY.'), 'argument' => array('field' => 'changed', 'id' => 'date_year'));
$data['users_field_data']['changed_month'] = array('title' => t('Updated month'), 'help' => t('Date in the form of MM (01 - 12).'), 'argument' => array('field' => 'changed', 'id' => 'date_month'));
$data['users_field_data']['changed_day'] = array('title' => t('Updated day'), 'help' => t('Date in the form of DD (01 - 31).'), 'argument' => array('field' => 'changed', 'id' => 'date_day'));
$data['users_field_data']['changed_week'] = array('title' => t('Updated week'), 'help' => t('Date in the form of WW (01 - 53).'), 'argument' => array('field' => 'changed', 'id' => 'date_week'));
if (\Drupal::moduleHandler()->moduleExists('content_translation')) {
$data['users']['translation_link'] = array('title' => t('Translation link'), 'help' => t('Provide a link to the translations overview for users.'), 'field' => array('id' => 'content_translation_link'));
}
$data['users']['edit_node'] = array('field' => array('title' => t('Link to edit user'), 'help' => t('Provide a simple link to edit the user.'), 'id' => 'user_link_edit', 'click sortable' => FALSE));
$data['users']['cancel_node'] = array('field' => array('title' => t('Link to cancel user'), 'help' => t('Provide a simple link to cancel the user.'), 'id' => 'user_link_cancel', 'click sortable' => FALSE));
$data['users']['data'] = array('title' => t('Data'), 'help' => t('Provides access to the user data service.'), 'real field' => 'uid', 'field' => array('id' => 'user_data'));
$data['users']['user_bulk_form'] = array('title' => t('Bulk update'), 'help' => t('Add a form element that lets you run operations on multiple users.'), 'field' => array('id' => 'user_bulk_form'));
$data['user__roles']['table']['group'] = t('User');
$data['user__roles']['table']['join'] = array('users_field_data' => array('left_field' => 'uid', 'field' => 'entity_id'));
$data['user__roles']['roles_target_id'] = array('title' => t('Roles'), 'help' => t('Roles that a user belongs to.'), 'field' => array('id' => 'user_roles', 'no group by' => TRUE), 'filter' => array('id' => 'user_roles', 'allow empty' => TRUE), 'argument' => array('id' => 'user__roles_target_id', 'name table' => 'role', 'name field' => 'name', 'empty field name' => t('No role'), 'zero is null' => TRUE, 'numeric' => TRUE));
$data['user__roles']['permission'] = array('title' => t('Permission'), 'help' => t('The user permissions.'), 'field' => array('id' => 'user_permissions', 'no group by' => TRUE), 'filter' => array('id' => 'user_permissions', 'real field' => 'roles_target_id'));
return $data;
}
示例10: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
$data['simplenews_subscriber']['edit_link'] = array('field' => array('title' => $this->t('Link to edit'), 'help' => $this->t('Provide a simple link to edit the subscriber.'), 'id' => 'subscriber_link_edit'));
$data['simplenews_subscriber']['delete_link'] = array('field' => array('title' => $this->t('Link to delete'), 'help' => $this->t('Provide a simple link to delete the subscriber.'), 'id' => 'subscriber_link_delete'));
// @todo Username obtained through custom plugin due to core issue.
$data['simplenews_subscriber']['user_name'] = array('real field' => 'uid', 'field' => array('title' => $this->t('Username'), 'help' => $this->t('Provide a simple link to the subscriber\'s user account .'), 'id' => 'simplenews_user_name'));
return $data;
}
示例11: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
$data['tmgmt_job_item']['label'] = array('title' => 'Label', 'help' => 'Displays a label of the job item.', 'real field' => 'tjiid', 'field' => array('id' => 'tmgmt_entity_label'));
$data['tmgmt_job_item']['progress'] = array('title' => 'Progress', 'help' => 'Displays the progress of a job item.', 'real field' => 'tjiid', 'field' => array('id' => 'tmgmt_progress'));
$data['tmgmt_job_item']['type'] = array('title' => t('Type'), 'help' => t('Displays a type of the job item.'), 'real field' => 'tjiid', 'field' => array('id' => 'tmgmt_job_item_type'));
$data['tmgmt_job_item']['state'] = array('title' => 'State', 'help' => 'Displays the state of the job item.', 'field' => array('id' => 'tmgmt_job_item_state'), 'filter' => array('id' => 'numeric'));
$data['tmgmt_job_item']['footer'] = array('title' => t('Job Item Overview legend'), 'help' => t('Add job item state legends'), 'area' => array('id' => 'tmgmt_job_item_legend'));
return $data;
}
示例12: getViewsData
/**
* Returns the Views data for the entity.
*/
public function getViewsData()
{
// Start with the Views information provided by the base class.
$data = parent::getViewsData();
// Define a wizard.
$data['myentity_field_data']['table']['wizard_id'] = 'myentity';
// You could also override labels or put in a custom field
// or filter handler.
return $data;
}
示例13: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
// @TODO There is no corresponding information in entity metadata.
$data['file_managed']['table']['base']['help'] = t('Files maintained by Drupal and various modules.');
$data['file_managed']['table']['base']['defaults']['field'] = 'filename';
$data['file_managed']['table']['wizard_id'] = 'file_managed';
$data['file_managed']['fid']['field']['id'] = 'file';
$data['file_managed']['fid']['argument'] = array('id' => 'file_fid', 'name field' => 'filename', 'numeric' => TRUE);
$data['file_managed']['fid']['relationship'] = array('title' => t('File usage'), 'help' => t('Relate file entities to their usage.'), 'id' => 'standard', 'base' => 'file_usage', 'base field' => 'fid', 'field' => 'fid', 'label' => t('File usage'));
$data['file_managed']['filename']['field']['id'] = 'file';
$data['file_managed']['uri']['field']['id'] = 'file_uri';
$data['file_managed']['filemime']['field']['id'] = 'file_filemime';
$data['file_managed']['extension'] = array('title' => t('Extension'), 'help' => t('The extension of the file.'), 'real field' => 'filename', 'field' => array('id' => 'file_extension', 'click sortable' => FALSE));
$data['file_managed']['filesize']['field']['id'] = 'file_size';
$data['file_managed']['status']['field']['id'] = 'file_status';
$data['file_managed']['status']['filter']['id'] = 'file_status';
$data['file_managed']['uid']['relationship']['title'] = t('User who uploaded');
$data['file_managed']['uid']['relationship']['label'] = t('User who uploaded');
$data['file_usage']['table']['group'] = t('File Usage');
// Provide field-type-things to several base tables; on the core files table
// ("file_managed") so that we can create relationships from files to
// entities, and then on each core entity type base table so that we can
// provide general relationships between entities and files.
$data['file_usage']['table']['join'] = array('file_managed' => array('field' => 'fid', 'left_field' => 'fid'), 'node' => array('field' => 'id', 'left_field' => 'nid', 'extra' => array(array('field' => 'type', 'value' => 'node'))), 'users' => array('field' => 'id', 'left_field' => 'uid', 'extra' => array(array('field' => 'type', 'value' => 'user'))), 'comment' => array('field' => 'id', 'left_field' => 'cid', 'extra' => array(array('field' => 'type', 'value' => 'comment'))), 'taxonomy_term_data' => array('field' => 'id', 'left_field' => 'tid', 'extra' => array(array('field' => 'type', 'value' => 'taxonomy_term'))), 'taxonomy_vocabulary' => array('field' => 'id', 'left_field' => 'vid', 'extra' => array(array('field' => 'type', 'value' => 'taxonomy_vocabulary'))));
// Provide a relationship between the files table and each entity type,
// and between each entity type and the files table. Entity->file
// relationships are type-restricted in the joins declared above, and
// file->entity relationships are type-restricted in the relationship
// declarations below.
// Describes relationships between files and nodes.
$data['file_usage']['file_to_node'] = array('title' => t('Content'), 'help' => t('Content that is associated with this file, usually because this file is in a field on the content.'), 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array('title' => t('Content'), 'label' => t('Content'), 'base' => 'node', 'base field' => 'nid', 'relationship field' => 'id', 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'node'))));
$data['file_usage']['node_to_file'] = array('title' => t('File'), 'help' => t('A file that is associated with this node, usually because it is in a field on the node.'), 'skip base' => array('file_managed', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), 'real field' => 'fid', 'relationship' => array('title' => t('File'), 'label' => t('File'), 'base' => 'file_managed', 'base field' => 'fid', 'relationship field' => 'fid'));
// Describes relationships between files and users.
$data['file_usage']['file_to_user'] = array('title' => t('User'), 'help' => t('A user that is associated with this file, usually because this file is in a field on the user.'), 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array('title' => t('User'), 'label' => t('User'), 'base' => 'users', 'base field' => 'uid', 'relationship field' => 'id', 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'user'))));
$data['file_usage']['user_to_file'] = array('title' => t('File'), 'help' => t('A file that is associated with this user, usually because it is in a field on the user.'), 'skip base' => array('file_managed', 'node', 'node_field_revision', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), 'real field' => 'fid', 'relationship' => array('title' => t('File'), 'label' => t('File'), 'base' => 'file_managed', 'base field' => 'fid', 'relationship field' => 'fid'));
// Describes relationships between files and comments.
$data['file_usage']['file_to_comment'] = array('title' => t('Comment'), 'help' => t('A comment that is associated with this file, usually because this file is in a field on the comment.'), 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array('title' => t('Comment'), 'label' => t('Comment'), 'base' => 'comment', 'base field' => 'cid', 'relationship field' => 'id', 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'comment'))));
$data['file_usage']['comment_to_file'] = array('title' => t('File'), 'help' => t('A file that is associated with this comment, usually because it is in a field on the comment.'), 'skip base' => array('file_managed', 'node', 'node_field_revision', 'users', 'taxonomy_term_data', 'taxonomy_vocabulary'), 'real field' => 'fid', 'relationship' => array('title' => t('File'), 'label' => t('File'), 'base' => 'file_managed', 'base field' => 'fid', 'relationship field' => 'fid'));
// Describes relationships between files and taxonomy_terms.
$data['file_usage']['file_to_taxonomy_term'] = array('title' => t('Taxonomy Term'), 'help' => t('A taxonomy term that is associated with this file, usually because this file is in a field on the taxonomy term.'), 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array('title' => t('Taxonomy Term'), 'label' => t('Taxonomy Term'), 'base' => 'taxonomy_term_data', 'base field' => 'tid', 'relationship field' => 'id', 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'taxonomy_term'))));
$data['file_usage']['taxonomy_term_to_file'] = array('title' => t('File'), 'help' => t('A file that is associated with this taxonomy term, usually because it is in a field on the taxonomy term.'), 'skip base' => array('file_managed', 'node', 'node_field_revision', 'users', 'comment', 'taxonomy_vocabulary'), 'real field' => 'fid', 'relationship' => array('title' => t('File'), 'label' => t('File'), 'base' => 'file_managed', 'base field' => 'fid', 'relationship field' => 'fid'));
// Describes relationships between files and taxonomy_vocabulary items.
$data['file_usage']['file_to_taxonomy_vocabulary'] = array('title' => t('Taxonomy Vocabulary'), 'help' => t('A taxonomy vocabulary that is associated with this file, usually because this file is in a field on the taxonomy vocabulary.'), 'skip base' => array('node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data', 'taxonomy_vocabulary'), 'real field' => 'id', 'relationship' => array('title' => t('Taxonomy Vocabulary'), 'label' => t('Taxonomy Vocabulary'), 'base' => 'taxonomy_vocabulary', 'base field' => 'vid', 'relationship field' => 'id', 'extra' => array(array('table' => 'file_usage', 'field' => 'type', 'operator' => '=', 'value' => 'taxonomy_vocabulary'))));
$data['file_usage']['taxonomy_vocabulary_to_file'] = array('title' => t('File'), 'help' => t('A file that is associated with this taxonomy vocabulary, usually because it is in a field on the taxonomy vocabulary.'), 'skip base' => array('file_managed', 'node', 'node_field_revision', 'users', 'comment', 'taxonomy_term_data'), 'real field' => 'fid', 'relationship' => array('title' => t('File'), 'label' => t('File'), 'base' => 'file_managed', 'base field' => 'fid', 'relationship field' => 'fid'));
// Provide basic fields from the {file_usage} table to all of the base tables
// we've declared joins to, because there is no 'skip base' property on these
// fields.
$data['file_usage']['module'] = array('title' => t('Module'), 'help' => t('The module managing this file relationship.'), 'field' => array('id' => 'standard'), 'filter' => array('id' => 'string'), 'argument' => array('id' => 'string'), 'sort' => array('id' => 'standard'));
$data['file_usage']['type'] = array('title' => t('Entity type'), 'help' => t('The type of entity that is related to the file.'), 'field' => array('id' => 'standard'), 'filter' => array('id' => 'string'), 'argument' => array('id' => 'string'), 'sort' => array('id' => 'standard'));
$data['file_usage']['id'] = array('title' => t('Entity ID'), 'help' => t('The ID of the entity that is related to the file.'), 'field' => array('id' => 'numeric'), 'argument' => array('id' => 'numeric'), 'filter' => array('id' => 'numeric'), 'sort' => array('id' => 'standard'));
$data['file_usage']['count'] = array('title' => t('Use count'), 'help' => t('The number of times the file is used by this entity.'), 'field' => array('id' => 'numeric'), 'filter' => array('id' => 'numeric'), 'sort' => array('id' => 'standard'));
$data['file_usage']['entity_label'] = array('title' => t('Entity label'), 'help' => t('The label of the entity that is related to the file.'), 'real field' => 'id', 'field' => array('id' => 'entity_label', 'entity type field' => 'type'));
return $data;
}
示例14: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = parent::getViewsData();
$data['ps_category']['table']['base'] = array(
'field' => 'id',
'title' => $this->t('Category'),
'help' => $this->t('The Category ID.'),
);
return $data;
}
示例15: getViewsData
/**
* {@inheritdoc}
*/
public function getViewsData()
{
$data = parent::getViewsData();
//
// $data['myeck']['table']['base'] = array(
// 'field' => 'id',
// 'title' => $this->t('Myeck entity'),
// 'help' => $this->t('The Myeck entity ID.'),
// );
return $data;
}