You are here

class EntityPut in Services 9.0.x

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

Class \Drupal\services\Plugin\Deriver\EntityPut.

Hierarchy

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

Expanded class hierarchy of EntityPut

File

src/Plugin/Deriver/EntityPut.php, line 11

Namespace

Drupal\services\Plugin\Deriver
View source
class EntityPut 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: Update', [
        '@label' => $entity_type
          ->getLabel(),
      ]);
      $this->derivatives[$entity_type_id]['description'] = $this
        ->t('Updates 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}/{{$entity_type_id}}";
      $this->derivatives[$entity_type_id]['context'] = [
        "{$entity_type_id}" => new ContextDefinition("entity:{$entity_type_id}", $this
          ->t('@label', [
          '@label' => $entity_type
            ->getLabel(),
        ])),
      ];
    }
    return $this->derivatives;
  }

}

Members