You are here

protected function EntityTypeInfo::buildWorkspace in Workspace 8

Parameters

\Drupal\Core\Entity\EntityTypeInterface $workspace:

Return value

\Drupal\Core\Entity\EntityTypeInterface

1 call to EntityTypeInfo::buildWorkspace()
EntityTypeInfo::entityTypeBuild in src/EntityTypeInfo.php

File

src/EntityTypeInfo.php, line 101

Class

EntityTypeInfo
Service class for manipulating entity type information.

Namespace

Drupal\workspace

Code

protected function buildWorkspace(EntityTypeInterface $workspace) {
  $workspace
    ->setHandlerClass('list_builder', WorkspaceListBuilder::class);
  $providers = $workspace
    ->getRouteProviderClasses() ?: [];
  $providers['html'] = AdminHtmlRouteProvider::class;
  $workspace
    ->setHandlerClass('route_provider', $providers);
  $workspace
    ->setFormClass('default', WorkspaceForm::class);
  $workspace
    ->setFormClass('add', WorkspaceForm::class);
  $workspace
    ->setFormClass('edit', WorkspaceForm::class);
  $workspace
    ->setFormClass('delete', WorkspaceDeleteForm::class);
  $workspace
    ->setLinkTemplate('collection', '/admin/structure/workspace');
  $workspace
    ->setLinkTemplate('canonical', '/admin/structure/workspace/{workspace}');
  $workspace
    ->setLinkTemplate('edit-form', '/admin/structure/workspace/{workspace}/edit');
  $workspace
    ->setLinkTemplate('delete-form', '/admin/structure/workspace/{workspace}/delete');
  $workspace
    ->setLinkTemplate('activate-form', '/admin/structure/workspace/{workspace}/activate');
  $workspace
    ->setLinkTemplate('unarchive-form', '/admin/structure/workspace/{workspace}/unarchive');
  $workspace
    ->setLinkTemplate('conflicts', '/admin/structure/workspace/{workspace}/conflicts');
  $workspace
    ->setLinkTemplate('changes', '/admin/structure/workspace/{workspace}/changes');
  $workspace
    ->set('field_ui_base_route', 'entity.workspace_type.edit_form');
  return $workspace;
}