You are here

Generic.php in Form mode manager 8.2

Same filename and directory in other branches
  1. 8 src/Plugin/EntityRoutingMap/Generic.php

File

src/Plugin/EntityRoutingMap/Generic.php
View source
<?php

namespace Drupal\form_mode_manager\Plugin\EntityRoutingMap;

use Drupal\form_mode_manager\EntityRoutingMapBase;

/**
 * Class Generic routing entity mapper.
 *
 * @EntityRoutingMap(
 *   id = "generic",
 *   label = @Translation("Generic Routes properties"),
 * )
 */
class Generic extends EntityRoutingMapBase {

  /**
   * {@inheritdoc}
   */
  public function setOperations() {
    $operations = [
      'add_form' => "entity.{$this->targetEntityType}.add_form",
      'edit_form' => "entity.{$this->targetEntityType}.edit_form",
      'add_page' => "{$this->targetEntityType}.add_page",
    ];
    $this->pluginDefinition['operations'] += $operations;
  }

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return [
      'entityTypeId' => '',
    ] + parent::defaultConfiguration();
  }

}

Classes

Namesort descending Description
Generic Class Generic routing entity mapper.