You are here

protected function EntityTypeInfo::buildWorkspaceType in Workspace 8

Parameters

\Drupal\Core\Entity\EntityTypeInterface $workspace_type:

Return value

\Drupal\Core\Entity\EntityTypeInterface

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

File

src/EntityTypeInfo.php, line 80

Class

EntityTypeInfo
Service class for manipulating entity type information.

Namespace

Drupal\workspace

Code

protected function buildWorkspaceType(EntityTypeInterface $workspace_type) {
  $workspace_type
    ->setHandlerClass('list_builder', WorkspaceTypeListBuilder::class);
  $providers = $workspace_type
    ->getRouteProviderClasses() ?: [];
  $providers['html'] = AdminHtmlRouteProvider::class;
  $workspace_type
    ->setHandlerClass('route_provider', $providers);
  $workspace_type
    ->setFormClass('default', WorkspaceTypeForm::class);
  $workspace_type
    ->setFormClass('add', WorkspaceTypeForm::class);
  $workspace_type
    ->setFormClass('edit', WorkspaceTypeForm::class);
  $workspace_type
    ->setFormClass('delete', WorkspaceTypeDeleteForm::class);
  $workspace_type
    ->setLinkTemplate('edit-form', '/admin/structure/workspace/types/{workspace_type}/edit');
  $workspace_type
    ->setLinkTemplate('delete-form', '/admin/structure/workspace/types/{workspace_type}/delete');
  $workspace_type
    ->setLinkTemplate('collection', '/admin/structure/workspace/types');
  return $workspace_type;
}