You are here

public function EntityOperation::summaryTitle in Views Entity Operation Access 8

Same name and namespace in other branches
  1. 2.x src/Plugin/views/access/EntityOperation.php \Drupal\veoa\Plugin\views\access\EntityOperation::summaryTitle()

Returns the summary of the settings in the display.

Overrides AccessPluginBase::summaryTitle

File

src/Plugin/views/access/EntityOperation.php, line 99

Class

EntityOperation
Access plugin checking if the current user can operate on an entity.

Namespace

Drupal\veoa\Plugin\views\access

Code

public function summaryTitle() {
  if ($this
    ->isValidConfig()) {
    if ($entity_type = $this->entityManager
      ->getDefinition($this->options['entity_type'], FALSE)) {
      return $this
        ->t('@entity_type: %operation', [
        '@entity_type' => $entity_type
          ->getLabel(),
        '%operation' => $this->options['operation'],
      ]);
    }
    else {
      return $this
        ->t('Missing entity type');
    }
  }
  else {
    return $this
      ->t('Not defined');
  }
}