You are here

class EntityIndex in Services 9.0.x

Same name in this branch
  1. 9.0.x src/Plugin/Deriver/EntityIndex.php \Drupal\services\Plugin\Deriver\EntityIndex
  2. 9.0.x src/Plugin/ServiceDefinition/EntityIndex.php \Drupal\services\Plugin\ServiceDefinition\EntityIndex
Same name and namespace in other branches
  1. 8.4 src/Plugin/Deriver/EntityIndex.php \Drupal\services\Plugin\Deriver\EntityIndex

Class \Drupal\services\Plugin\Deriver\EntityIndex.

Hierarchy

  • class \Drupal\services\Plugin\Deriver\EntityIndex extends \Drupal\ctools\Plugin\Deriver\EntityDeriverBase

Expanded class hierarchy of EntityIndex

File

src/Plugin/Deriver/EntityIndex.php, line 10

Namespace

Drupal\services\Plugin\Deriver
View source
class EntityIndex extends EntityDeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    foreach ($this->entityTypeManager
      ->getDefinitions() as $entity_type_id => $entity_type) {
      $this->derivatives[$entity_type_id] = $base_plugin_definition;
      $this->derivatives[$entity_type_id]['title'] = $this
        ->t('@label: Index', [
        '@label' => $entity_type
          ->getLabel(),
      ]);
      $this->derivatives[$entity_type_id]['description'] = $this
        ->t('Index of @entity_type_id objects.', [
        '@entity_type_id' => $entity_type_id,
      ]);
      $this->derivatives[$entity_type_id]['category'] = $this
        ->t('@label', [
        '@label' => $entity_type
          ->getLabel(),
      ]);
      $this->derivatives[$entity_type_id]['path'] = "{$entity_type_id}";
    }
    return $this->derivatives;
  }

}

Members