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.

1 call to HandlerBase::getEntityType()
BulkForm::views_form in drupal/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.php
Implements \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::views_form().

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php, line 819
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_fetch_data($this->view->relationship->table);
  }
  else {
    $views_data = views_fetch_data($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
        ->get('name'),
    )));
  }
}