Determines the entity type used by this handler.
If this handler uses a relationship, the base class of the relationship is taken into account.
string The machine name of the entity type.
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(),
)));
}
}