public function HandlerBase::getEntityType

Determines the entity type used by this handler.

If this handler uses a relationship, the base class of the relationship is taken into account.

Return value

string The machine name of the entity type.

2 calls to HandlerBase::getEntityType()
BulkForm::getBulkOptions in drupal/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.php
Implements \Drupal\system\Plugin\views\field\BulkFormBase::getBulkOptions().
Bundle::init in drupal/core/modules/views/lib/Drupal/views/Plugin/views/filter/Bundle.php
Overrides \Drupal\views\Plugin\views\filter\InOperator::init().

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php, line 689
Definition of Drupal\views\Plugin\views\HandlerBase.

Class

HandlerBase

Namespace

Drupal\views\Plugin\views

Code

public function getEntityType() {

  // If the user has configured a relationship on the handler take that into
  // account.
  if (!empty($this->options['relationship']) && $this->options['relationship'] != 'none') {
    $views_data = Views::viewsData()
      ->get($this->view->relationship->table);
  }
  else {
    $views_data = Views::viewsData()
      ->get($this->view->storage
      ->get('base_table'));
  }
  if (isset($views_data['table']['entity type'])) {
    return $views_data['table']['entity type'];
  }
  else {
    throw new \Exception(format_string('No entity type for field @field on view @view', array(
      '@field' => $this->options['id'],
      '@view' => $this->view->storage
        ->id(),
    )));
  }
}