You are here

class AliasGet in Services 9.0.x

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

Class \Drupal\services\Plugin\Deriver\AliasGet.

Hierarchy

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

Expanded class hierarchy of AliasGet

File

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

Namespace

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

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    foreach ($this->entityTypeManager
      ->getDefinitions() as $entity_type_id => $entity_type) {
      if ($entity_type_id === 'node') {
        $this->derivatives[$entity_type_id] = $base_plugin_definition;
        $this->derivatives[$entity_type_id]['title'] = $this
          ->t('@label: Alias Retrieve', [
          '@label' => $entity_type
            ->getLabel(),
        ]);
        $this->derivatives[$entity_type_id]['description'] = $this
          ->t('Retrieves a @entity_type_id object and serializes it as a response to the current request.', [
          '@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}_alias";
      }
    }
    return $this->derivatives;
  }

}

Members