Commit 5f2428ee authored by catch's avatar catch

Issue #2879385 by vijaycs85: Move workflow entity handlers to entity annotation

parent b327840d
......@@ -20,16 +20,37 @@
* label_collection = @Translation("Workflows"),
* handlers = {
* "access" = "Drupal\workflows\WorkflowAccessControlHandler",
* "list_builder" = "Drupal\workflows\WorkflowListBuilder",
* "form" = {
* "add" = "Drupal\workflows\Form\WorkflowAddForm",
* "edit" = "Drupal\workflows\Form\WorkflowEditForm",
* "delete" = "Drupal\workflows\Form\WorkflowDeleteForm",
* "add-state" = "Drupal\workflows\Form\WorkflowStateAddForm",
* "edit-state" = "Drupal\workflows\Form\WorkflowStateEditForm",
* "delete-state" = "Drupal\workflows\Form\WorkflowStateDeleteForm",
* "add-transition" = "Drupal\workflows\Form\WorkflowTransitionAddForm",
* "edit-transition" = "Drupal\workflows\Form\WorkflowTransitionEditForm",
* "delete-transition" = "Drupal\workflows\Form\WorkflowTransitionDeleteForm",
* },
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
* },
* }
* },
* config_prefix = "workflow",
* admin_permission = "administer workflows",
* entity_keys = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid",
* },
* links = {
* "add-form" = "/admin/config/workflow/workflows/add",
* "edit-form" = "/admin/config/workflow/workflows/manage/{workflow}",
* "delete-form" = "/admin/config/workflow/workflows/manage/{workflow}/delete",
* "add-state-form" = "/admin/config/workflow/workflows/manage/{workflow}/add_state",
* "add-transition-form" = "/admin/config/workflow/workflows/manage/{workflow}/add_transition",
* "collection" = "/admin/config/workflow/workflows"
* },
* config_export = {
* "id",
* "label",
......
......@@ -7,17 +7,6 @@
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\workflows\Form\WorkflowAddForm;
use Drupal\workflows\Form\WorkflowEditForm;
use Drupal\workflows\Form\WorkflowDeleteForm;
use Drupal\workflows\Form\WorkflowStateAddForm;
use Drupal\workflows\Form\WorkflowStateEditForm;
use Drupal\workflows\Form\WorkflowStateDeleteForm;
use Drupal\workflows\Form\WorkflowTransitionAddForm;
use Drupal\workflows\Form\WorkflowTransitionEditForm;
use Drupal\workflows\Form\WorkflowTransitionDeleteForm;
use Drupal\workflows\WorkflowListBuilder;
/**
* Implements hook_help().
*/
......@@ -31,28 +20,3 @@ function workflows_help($route_name, RouteMatchInterface $route_match) {
return $output;
}
}
/**
* Implements hook_entity_type_build().
*/
function workflows_entity_type_build(array &$entity_types) {
/** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
$entity_types['workflow']
->setFormClass('add', WorkflowAddForm::class)
->setFormClass('edit', WorkflowEditForm::class)
->setFormClass('delete', WorkflowDeleteForm::class)
->setFormClass('add-state', WorkflowStateAddForm::class)
->setFormClass('edit-state', WorkflowStateEditForm::class)
->setFormClass('delete-state', WorkflowStateDeleteForm::class)
->setFormClass('add-transition', WorkflowTransitionAddForm::class)
->setFormClass('edit-transition', WorkflowTransitionEditForm::class)
->setFormClass('delete-transition', WorkflowTransitionDeleteForm::class)
->setListBuilderClass(WorkflowListBuilder::class)
->set('admin_permission', 'administer workflows')
->setLinkTemplate('add-form', '/admin/config/workflow/workflows/add')
->setLinkTemplate('edit-form', '/admin/config/workflow/workflows/manage/{workflow}')
->setLinkTemplate('delete-form', '/admin/config/workflow/workflows/manage/{workflow}/delete')
->setLinkTemplate('add-state-form', '/admin/config/workflow/workflows/manage/{workflow}/add_state')
->setLinkTemplate('add-transition-form', '/admin/config/workflow/workflows/manage/{workflow}/add_transition')
->setLinkTemplate('collection', '/admin/config/workflow/workflows');
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment