PollViewData.php in Poll 8        
                          
                  
                        
  
  
  
  
  
File
  src/PollViewData.php
  
    View source  
  <?php
namespace Drupal\poll;
use Drupal\views\EntityViewsData;
class PollViewData extends EntityViewsData {
  
  public function getViewsData() {
    $data = parent::getViewsData();
    $data['poll_field_data']['votes'] = array(
      'title' => 'Total votes',
      'help' => 'Displays the total number of votes.',
      'real field' => 'id',
      'field' => array(
        'id' => 'poll_totalvotes',
      ),
    );
    $data['poll_field_data']['status_with_runtime'] = array(
      'title' => 'Active with runtime',
      'help' => 'Displays the status with runtime.',
      'real field' => 'id',
      'field' => array(
        'id' => 'poll_status',
      ),
    );
    return $data;
  }
}