Ejemplo n.º 1
0
 /**
  * {@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;
 }
Ejemplo n.º 2
0
 /**
  * {@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;
 }
 /**
  * {@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;
 }
Ejemplo n.º 4
0
 /**
  * {@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;
 }
 /**
  * {@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;
 }
Ejemplo n.º 6
0
 /**
  * {@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;
 }
  /**
   * {@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;
  }
Ejemplo n.º 8
0
 /**
  * {@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;
 }
Ejemplo n.º 9
0
 /**
  * {@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;
 }
 /**
  * {@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;
 }
Ejemplo n.º 11
0
 /**
  * {@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;
 }
 /**
  * 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;
 }
 /**
  * {@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;
 }
Ejemplo n.º 14
0
  /**
   * {@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;
  }
  /**
   * {@inheritdoc}
   */
  public function getViewsData() {
    $data = parent::getViewsData();

    $data['fillpdf_file_context']['table']['base'] = array(
      'field' => 'id',
      'title' => $this->t('FillPDF file context'),
      'help' => $this->t('The FillPDF file context ID.'),
    );

    return $data;
  }
  /**
   * {@inheritdoc}
   */
  public function getViewsData() {
    $data = parent::getViewsData();

    $data['ps_presentation']['table']['base'] = array(
      'field' => 'id',
      'title' => $this->t('Presentation'),
      'help' => $this->t('The Presentation ID.'),
    );

    return $data;
  }
Ejemplo n.º 17
0
 /**
  * {@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;
 }
Ejemplo n.º 18
0
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     // Cart items table.
     $data['uc_cart_products']['table']['group'] = $this->t('Cart item');
     $data['uc_cart_products']['table']['base'] = array('field' => 'cart_item_id', 'title' => $this->t('Cart items'), 'help' => $this->t('Products in customer carts.'));
     $data['uc_cart_products']['nid'] = array('title' => $this->t('Nid'), 'help' => $this->t('The node ID of a product in the cart.'), 'field' => array('id' => 'node', 'click sortable' => TRUE), 'relationship' => array('title' => $this->t('Node'), 'help' => $this->t('Relate cart item to node.'), 'id' => 'standard', 'base' => 'node', 'field' => 'nid', 'label' => $this->t('node')), 'argument' => array('id' => 'node_nid', 'name field' => 'title'), 'sort' => array('id' => 'standard'), 'filter' => array('id' => 'numeric'));
     $data['uc_cart_products']['cart_id'] = array('title' => $this->t('Cart ID'), 'help' => $this->t('The ID of the cart (user ID for authenticated users, session ID for anonymous users).'), 'field' => array('id' => 'standard', 'click sortable' => TRUE), 'argument' => array('id' => 'user_uid', 'name field' => 'name'), 'sort' => array('id' => 'standard'), 'filter' => array('id' => 'standard'));
     $data['uc_cart_products']['qty'] = array('title' => $this->t('Quantity'), 'help' => $this->t('The quantity to be ordered.'), 'field' => array('id' => 'numeric', 'click sortable' => TRUE), 'sort' => array('id' => 'standard'), 'filter' => array('id' => 'numeric'));
     return $data;
 }
 /**
  * {@inheritdoc}
  */
 public function getViewsData() {
   $data = parent::getViewsData();
   $data['eform_submission']['eform_submission_bulk_form'] = array(
     'title' => t('Bulk update'),
     'help' => t('Add a form element that lets you run operations on multiple EForm Submissions.'),
     'field' => array(
       //'id' => 'eform_submission_bulk_form',
       'id' => 'bulk_form',
     ),
   );
   return $data;
 }
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     $data['taxonomy_term_data']['table']['base']['help'] = t('Taxonomy terms are attached to nodes.');
     $data['taxonomy_term_data']['table']['base']['access query tag'] = 'term_access';
     $data['taxonomy_term_data']['table']['wizard_id'] = 'taxonomy_term';
     $data['taxonomy_term_data']['table']['join'] = array('taxonomy_index' => array('field' => 'tid', 'left_field' => 'tid'));
     $data['taxonomy_term_data']['tid']['help'] = t('The tid of a taxonomy term.');
     $data['taxonomy_term_data']['tid']['argument']['id'] = 'taxonomy';
     $data['taxonomy_term_data']['tid']['argument']['name field'] = 'name';
     $data['taxonomy_term_data']['tid']['argument']['zero is null'] = TRUE;
     $data['taxonomy_term_data']['tid']['filter']['id'] = 'taxonomy_index_tid';
     $data['taxonomy_term_data']['tid']['filter']['title'] = t('Term');
     $data['taxonomy_term_data']['tid']['filter']['help'] = t('Taxonomy term chosen from autocomplete or select widget.');
     $data['taxonomy_term_data']['tid']['filter']['hierarchy table'] = 'taxonomy_term_hierarchy';
     $data['taxonomy_term_data']['tid']['filter']['numeric'] = TRUE;
     $data['taxonomy_term_data']['tid_raw'] = array('title' => t('Term ID'), 'help' => t('The tid of a taxonomy term.'), 'real field' => 'tid', 'filter' => array('id' => 'numeric', 'allow empty' => TRUE));
     $data['taxonomy_term_data']['tid_representative'] = array('relationship' => array('title' => t('Representative node'), 'label' => t('Representative node'), 'help' => t('Obtains a single representative node for each term, according to a chosen sort criterion.'), 'id' => 'groupwise_max', 'relationship field' => 'tid', 'outer field' => 'taxonomy_term_field_data.tid', 'argument table' => 'taxonomy_term_field_data', 'argument field' => 'tid', 'base' => 'node', 'field' => 'nid', 'relationship' => 'node:term_node_tid'));
     $data['taxonomy_term_data']['vid']['help'] = t('Filter the results of "Taxonomy: Term" to a particular vocabulary.');
     unset($data['taxonomy_term_data']['vid']['field']);
     unset($data['taxonomy_term_data']['vid']['argument']);
     unset($data['taxonomy_term_data']['vid']['sort']);
     $data['taxonomy_term_data']['edit_term'] = array('field' => array('title' => t('Term edit link'), 'help' => t('Provide a simple link to edit the term.'), 'id' => 'term_link_edit', 'click sortable' => FALSE));
     if (\Drupal::moduleHandler()->moduleExists('content_translation')) {
         $data['taxonomy_term_data']['translation_link'] = array('title' => t('Translation link'), 'help' => t('Provide a link to the translations overview for taxonomy terms.'), 'field' => array('id' => 'content_translation_link'));
     }
     $data['taxonomy_term_field_data']['name']['field']['id'] = 'taxonomy';
     $data['taxonomy_term_field_data']['name']['argument']['many to one'] = TRUE;
     $data['taxonomy_term_field_data']['name']['argument']['empty field name'] = t('Uncategorized');
     $data['taxonomy_term_field_data']['description__value']['field']['click sortable'] = FALSE;
     $data['taxonomy_term_field_data']['langcode']['field']['id'] = 'taxonomy_term_language';
     $data['taxonomy_term_field_data']['changed']['title'] = t('Updated date');
     $data['taxonomy_term_field_data']['changed']['help'] = t('The date the term was last updated.');
     $data['taxonomy_term_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['taxonomy_term_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['taxonomy_term_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['taxonomy_term_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['taxonomy_term_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['taxonomy_term_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'));
     $data['taxonomy_index']['table']['group'] = t('Taxonomy term');
     $data['taxonomy_index']['table']['join'] = array('taxonomy_term_data' => array('left_field' => 'tid', 'field' => 'tid'), 'node' => array('left_field' => 'nid', 'field' => 'nid'), 'taxonomy_term_hierarchy' => array('left_field' => 'tid', 'field' => 'tid'));
     $data['taxonomy_index']['nid'] = array('title' => t('Content with term'), 'help' => t('Relate all content tagged with a term.'), 'relationship' => array('id' => 'standard', 'base' => 'node', 'base field' => 'nid', 'label' => t('node'), 'skip base' => 'node'));
     // @todo This stuff needs to move to a node field since really it's all about
     //   nodes.
     $data['taxonomy_index']['tid'] = array('group' => t('Content'), 'title' => t('Has taxonomy term ID'), 'help' => t('Display content if it has the selected taxonomy terms.'), 'argument' => array('id' => 'taxonomy_index_tid', 'name table' => 'taxonomy_term_field_data', 'name field' => 'name', 'empty field name' => t('Uncategorized'), 'numeric' => TRUE, 'skip base' => 'taxonomy_term_data'), 'filter' => array('title' => t('Has taxonomy term'), 'id' => 'taxonomy_index_tid', 'hierarchy table' => 'taxonomy_term_hierarchy', 'numeric' => TRUE, 'skip base' => 'taxonomy_term_data', 'allow empty' => TRUE));
     $data['taxonomy_index']['sticky'] = ['title' => t('Sticky status'), 'help' => t('Whether or not the content related to a term is sticky.'), 'filter' => ['id' => 'boolean', 'label' => t('Sticky status'), 'type' => 'yes-no'], 'sort' => ['id' => 'standard', 'help' => t('Whether or not the content related to a term is sticky. To list sticky content first, set this to descending.')]];
     $data['taxonomy_index']['created'] = ['title' => t('Post date'), 'help' => t('The date the content related to a term was posted.'), 'sort' => ['id' => 'date'], 'filter' => ['id' => 'date']];
     $data['taxonomy_term_hierarchy']['table']['group'] = t('Taxonomy term');
     $data['taxonomy_term_hierarchy']['table']['join'] = array('taxonomy_term_hierarchy' => array('left_field' => 'tid', 'field' => 'parent'), 'taxonomy_term_data' => array('left_field' => 'tid', 'field' => 'tid'));
     $data['taxonomy_term_hierarchy']['parent'] = array('title' => t('Parent term'), 'help' => t('The parent term of the term. This can produce duplicate entries if you are using a vocabulary that allows multiple parents.'), 'relationship' => array('base' => 'taxonomy_term_data', 'field' => 'parent', 'label' => t('Parent'), 'id' => 'standard'), 'filter' => array('help' => t('Filter the results of "Taxonomy: Term" by the parent pid.'), 'id' => 'numeric'), 'argument' => array('help' => t('The parent term of the term.'), 'id' => 'taxonomy'));
     return $data;
 }
Ejemplo n.º 21
0
 /**
  * @inheritDoc
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     $base_table = $this->entityType->getBaseTable() ?: $this->entityType->id();
     $data[$base_table]['table']['base']['database'] = 'moodle';
     $data[$base_table]['category']['help'] = t('The moodle course category in which the course belongs. If you need more fields than the category ID add the Moodle: category relationship');
     $data[$base_table]['category']['filter']['id'] = 'moodle_category';
     $data['course_categories']['table']['group'] = t('Moodle catogories');
     $data['course_categories']['table']['join'] = array('course' => array('left_field' => 'category', 'field' => 'id'));
     $data['course_categories']['id'] = array('title' => t('Categories'), 'help' => t('Category in which a course belongs to.'), 'field' => array('id' => 'moodle_category'));
     $data[$base_table]['course_uid'] = array('help' => t('Display courses of a user.'), 'real field' => 'id', 'argument' => array('title' => t('Course user ID'), 'id' => 'moodle_user_uid'));
     return $data;
 }
Ejemplo n.º 22
0
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     $data['tmgmt_local_task']['status'] = array('title' => t('Status'), 'help' => t('Display the status of the task.'), 'field' => array('id' => 'tmgmt_local_task_status'), 'filter' => array('id' => 'numeric'));
     $data['tmgmt_local_task']['progress'] = array('title' => t('Progress'), 'help' => t('Displays the progress of a job.'), 'real field' => 'tltid', 'field' => array('id' => 'tmgmt_local_progress'));
     $data['tmgmt_local_task']['word_count'] = array('title' => t('Word count'), 'help' => t('Displays the word count of a job.'), 'real field' => 'tltid', 'field' => array('id' => 'tmgmt_local_wordcount'));
     $data['tmgmt_local_task']['item_count'] = array('title' => t('Item count'), 'help' => t('Show the amount of items per task (per job item status)'), 'real field' => 'tltid', 'field' => array('id' => 'tmgmt_local_item_count'));
     $data['tmgmt_job']['eligible'] = array('title' => t('Eligible'), 'help' => t('Limit translation tasks to those that the user can translate'), 'real field' => 'tltid', 'filter' => array('id' => 'tmgmt_local_task_eligible'));
     // Manager handlers.
     $data['tmgmt_job']['task'] = array('title' => t('Translation task'), 'help' => t('Get the translation task of the job'), 'relationship' => array('base' => 'tmgmt_local_task', 'base field' => 'tjid', 'real field' => 'tjid', 'label' => t('Job')));
     $data['tmgmt_local_task']['footer'] = array('title' => t('Task Overview legend'), 'help' => t('Add task state legends'), 'area' => array('id' => 'tmgmt_local_task_legend'));
     return $data;
 }
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     // Use flexible $base_table, since both WorkflowTransition and
     // WorkflowScheduledTransition use this.
     $base_table = $this->entityType->getBaseTable();
     $base_field = $this->entityType->getKey('id');
     // @todo D8-port: Add data from D7 function workflow_views_views_data_alter()
     // @see http://cgit.drupalcode.org/workflow/tree/workflow_views/workflow_views.views.inc
     $data[$base_table]['from_sid']['filter']['id'] = 'workflow_state';
     $data[$base_table]['to_sid']['filter']['id'] = 'workflow_state';
     return $data;
 }
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     // Add base field reference for groups.
     $registration_definition = \Drupal::entityManager()->getDefinition('registration');
     $group_definition = \Drupal::entityManager()->getDefinition('registration_group');
     $t_args = ['@origin_label' => $group_definition->getLabel(), '@target_label' => $registration_definition->getLabel()];
     // Target ID can be NULL.
     $data['registration_group_field_data']['event__target_id']['filter']['allow empty'] = TRUE;
     // Reverse relationship (Target to Origin).
     $psuedo_field = 'rng_registration_group__registration';
     $data['registration_group_field_data'][$psuedo_field]['relationship'] = ['title' => t('@target_labels', $t_args), 'label' => t('@target_labels', $t_args), 'group' => $group_definition->getLabel(), 'help' => t('References to the @target_labels of a @origin_label.', $t_args), 'entity_type' => $registration_definition->id(), 'id' => 'entity_reverse', 'base' => $registration_definition->getDataTable() ?: $registration_definition->getBaseTable(), 'base field' => $registration_definition->getKey('id'), 'field_name' => 'groups', 'field table' => 'registration__groups', 'field field' => 'groups_target_id', 'relationship field' => $group_definition->getKey('id')];
     return $data;
 }
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     $registration_definition = \Drupal::entityManager()->getDefinition('registration');
     $group_definition = \Drupal::entityManager()->getDefinition('registration_group');
     // Add base field reference for groups.
     $t_args = ['@origin_label' => $registration_definition->getLabel(), '@target_label' => $group_definition->getLabel()];
     $data['registration__groups']['table']['group'] = $group_definition->getLabel();
     $data['registration__groups']['table']['join']['registration_field_data'] = ['left_field' => 'id', 'field' => 'entity_id'];
     $data['registration__groups']['groups_target_id'] = ['title' => t('Group ID'), 'help' => t('A @target_labels group ID.', $t_args), 'field' => ['id' => 'numeric'], 'argument' => ['id' => 'numeric'], 'filter' => ['id' => 'numeric', 'allow empty' => TRUE], 'sort' => ['id' => 'standard']];
     $psuedo_field = 'rng_registration__registration_group';
     $data['registration__groups'][$psuedo_field]['relationship'] = ['title' => t('@target_labels', $t_args), 'label' => t('@target_labels', $t_args), 'group' => $registration_definition->getLabel(), 'help' => t('References to the @target_labels of a @origin_label.', $t_args), 'id' => 'standard', 'base' => 'registration_group_field_data', 'base field' => $group_definition->getKey('id'), 'relationship field' => 'groups_target_id'];
     return $data;
 }
Ejemplo n.º 26
0
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     $data['tmgmt_job']['progress'] = array('title' => 'Progress', 'help' => 'Displays the progress of a job.', 'real field' => 'tjid', 'field' => array('id' => 'tmgmt_progress'));
     $data['tmgmt_job']['word_count'] = array('title' => 'Word count', 'help' => 'Displays the word count of a job.', 'real field' => 'tjid', 'field' => array('id' => 'tmgmt_wordcount'), 'sort' => array());
     $data['tmgmt_job']['tags_count'] = array('title' => 'Tags count', 'help' => 'Displays the HTML tags count of a job.', 'real field' => 'tjid', 'field' => array('id' => 'tmgmt_tagscount'));
     $data['tmgmt_job']['label'] = array('title' => 'Label', 'help' => 'Displays a label of the job item.', 'real field' => 'tjid', 'field' => array('id' => 'tmgmt_entity_label'), 'sort' => array());
     $data['tmgmt_job']['translator']['field']['id'] = 'tmgmt_translator';
     $data['tmgmt_job']['translator']['field']['options callback'] = 'tmgmt_translator_labels';
     $data['tmgmt_job']['translator']['filter']['id'] = 'in_operator';
     $data['tmgmt_job']['translator']['filter']['options callback'] = 'tmgmt_translator_labels';
     $data['tmgmt_job']['job_type'] = array('title' => 'Job Type (Custom)', 'help' => 'Displays the job type filter.', 'field' => array('id' => 'tmgmt_job_type'), 'filter' => array('id' => 'tmgmt_job_type_filter'));
     $data['tmgmt_job']['state'] = array('title' => 'States', 'help' => 'Displays the state of the job.', 'field' => array('id' => 'tmgmt_job_state'), 'filter' => array('id' => 'tmgmt_job_state_filter'));
     $data['tmgmt_job']['footer'] = array('title' => t('Job Overview legend'), 'help' => t('Add job state legends'), 'area' => array('id' => 'tmgmt_job_legend'));
     return $data;
 }
Ejemplo n.º 27
0
  /**
   * {@inheritdoc}
   */
  public function getViewsData() {
    $data = parent::getViewsData();

    $data['profile']['label'] = [
      'title' => t('Label'),
      'help' => t('The label of the profile item.'),
      'field' => [
        'id' => 'profile_label',
      ],
    ];

    $data['profile']['view_profile'] = [
      'field' => [
        'title' => t('Link to profile'),
        'help' => t('Provide a simple link to the profile.'),
        'id' => 'profile_link',
      ],
    ];

    $data['profile']['edit_profile'] = [
      'field' => [
        'title' => t('Link to edit profile'),
        'help' => t('Provide a simple link to edit the profile.'),
        'id' => 'profile_link_edit',
      ],
    ];

    $data['profile']['delete_profile'] = [
      'field' => [
        'title' => t('Link to delete profile'),
        'help' => t('Provide a simple link to delete the profile.'),
        'id' => 'profile_link_delete',
      ],
    ];

    $data['profile']['profile_bulk_form'] = [
      'title' => t('Profile operations bulk form'),
      'help' => t('Add a form element that lets you run operations on multiple profiles.'),
      'field' => [
        'id' => 'profile_bulk_form',
      ],
    ];

    return $data;
  }
 /**
  * @param ContentEntityTypeInterface $entity
  * @return array
  */
 public function getViewsData(ContentEntityTypeInterface $entity = NULL)
 {
     $data = parent::getViewsData();
     if ($entity) {
         // Get some info to work off.
         /** @var string $entity_table */
         $entity_table = $entity->get('base_table');
         /** @var string $entity_data_table */
         $entity_data_table = $entity->get('data_table');
         /** @var string $entity_revision_table */
         $entity_revision_table = $entity->get('revision_table');
         // Replacements for all strings.
         $replacements = ['@entity_label' => $entity->getLabel(), '!entity_id' => $entity->id()];
         if (!empty($entity_data_table)) {
             // Add the entity ID field.
             $data[$entity_data_table]['id']['field']['id'] = 'field';
             // Add entity info.
             $data[$entity_data_table]['info']['field']['id'] = 'field';
             $data[$entity_data_table]['info']['field']['link_to_entity default'] = TRUE;
             // Add the bundle (type).
             $data[$entity_data_table]['type']['field']['id'] = 'field';
         }
         if (!empty($entity_table) && !empty($entity_revision_table)) {
             // Advertise this table as a possible base table.
             $data[$entity_revision_table]['table']['base']['help'] = $this->t('@entity_label revision is a history of changes to a "!entity_id" entity.', $replacements);
             $data[$entity_revision_table]['table']['base']['defaults']['title'] = 'info';
             // @todo EntityViewsData should add these relationships by default.
             //   https://www.drupal.org/node/2410275
             $data[$entity_revision_table]['id']['relationship']['id'] = 'standard';
             $data[$entity_revision_table]['id']['relationship']['base'] = $entity_table;
             $data[$entity_revision_table]['id']['relationship']['base field'] = 'id';
             $data[$entity_revision_table]['id']['relationship']['title'] = $this->t('@entity_label', $replacements);
             $data[$entity_revision_table]['id']['relationship']['label'] = $this->t('Get the actual @entity_label from a @entity_label revision.', $replacements);
             $data[$entity_revision_table]['revision_id']['relationship']['id'] = 'standard';
             $data[$entity_revision_table]['revision_id']['relationship']['base'] = $entity_table;
             $data[$entity_revision_table]['revision_id']['relationship']['base field'] = 'revision_id';
             $data[$entity_revision_table]['revision_id']['relationship']['title'] = $this->t('@entity_label', $replacements);
             $data[$entity_revision_table]['revision_id']['relationship']['label'] = $this->t('Get the actual @entity_label from a @entity_label revision.', $replacements);
         }
     }
     return $data;
 }
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     unset($data['payment']['payment_method__plugin_configuration']);
     unset($data['payment']['payment_type__plugin_configuration']);
     $data['payment']['payment_method__plugin_id']['field'] = ['id' => 'payment_method_label'];
     $data['payment']['payment_method__plugin_id']['filter'] = ['id' => 'payment_method'];
     $data['payment']['payment_type__plugin_id']['field'] = ['id' => 'payment_type_label'];
     $data['payment']['current_payment_status_delta'] = array('title' => t('Current payment status'), 'relationship' => array('title' => t('Current payment status'), 'base' => 'payment__payment_statuses', 'base field' => 'delta', 'id' => 'payment_current_status', 'label' => t('Current payment status')));
     $data['payment']['id_payment_statuses'] = array('title' => t('Payment status'), 'real field' => 'id', 'relationship' => array('title' => t('Payment statuses'), 'base' => 'payment__payment_statuses', 'base field' => 'entity_id', 'id' => 'standard', 'label' => t('Payment statuses')));
     $data['payment']['id_payment_line_items'] = array('title' => t('Line items'), 'real field' => 'id', 'relationship' => array('title' => t('Line items'), 'base' => 'payment__line_items', 'base field' => 'entity_id', 'id' => 'standard', 'label' => t('Line items')));
     $data['payment']['amount'] = array('title' => t('Amount'), 'real field' => 'id', 'field' => ['id' => 'payment_amount']);
     $data['payment__line_items']['table']['group'] = $this->t('Payment line item');
     $data['payment__line_items']['table']['provider'] = $this->entityType->getProvider();
     $data['payment__line_items']['line_items_plugin_id'] = ['title' => t('Line item'), 'field' => ['id' => 'payment_line_item_label']];
     $data['payment__payment_statuses']['table']['group'] = $this->t('Payment status');
     $data['payment__payment_statuses']['table']['provider'] = $this->entityType->getProvider();
     $data['payment__payment_statuses']['payment_statuses_plugin_id'] = ['title' => t('Payment status'), 'field' => ['id' => 'payment_status_label'], 'filter' => ['id' => 'payment_status']];
     return $data;
 }
Ejemplo n.º 30
0
 /**
  * {@inheritdoc}
  */
 public function getViewsData()
 {
     $data = parent::getViewsData();
     $data['aggregator_feed']['table']['join'] = array('aggregator_item' => array('left_field' => 'fid', 'field' => 'fid'));
     $data['aggregator_feed']['fid']['help'] = $this->t('The unique ID of the aggregator feed.');
     $data['aggregator_feed']['fid']['argument']['id'] = 'aggregator_fid';
     $data['aggregator_feed']['fid']['argument']['name field'] = 'title';
     $data['aggregator_feed']['fid']['argument']['numeric'] = TRUE;
     $data['aggregator_feed']['fid']['filter']['id'] = 'numeric';
     $data['aggregator_feed']['title']['help'] = $this->t('The title of the aggregator feed.');
     $data['aggregator_feed']['title']['field']['default_formatter'] = 'aggregator_title';
     $data['aggregator_feed']['argument']['id'] = 'string';
     $data['aggregator_feed']['url']['help'] = $this->t('The fully-qualified URL of the feed.');
     $data['aggregator_feed']['link']['help'] = $this->t('The link to the source URL of the feed.');
     $data['aggregator_feed']['checked']['help'] = $this->t('The date the feed was last checked for new content.');
     $data['aggregator_feed']['description']['help'] = $this->t('The description of the aggregator feed.');
     $data['aggregator_feed']['description']['field']['click sortable'] = FALSE;
     $data['aggregator_feed']['modified']['help'] = $this->t('The date of the most recent new content on the feed.');
     return $data;
 }