You are here

public function TypeGroupController::add in Booking and Availability Management Tools for Drupal 8

Provides the type group submission form.

Parameters

\Drupal\bat\TypeGroupBundleInterface $type_group_bundle: The type group bundle entity for the type group.

Return value

array A type group submission form.

1 string reference to 'TypeGroupController::add'
bat.routing.yml in ./bat.routing.yml
bat.routing.yml

File

src/Controller/TypeGroupController.php, line 74
Contains \Drupal\bat\Controller\TypeGroupController.

Class

TypeGroupController
Returns responses for Type Group routes.

Namespace

Drupal\bat\Controller

Code

public function add(TypeGroupBundleInterface $type_group_bundle) {
  $type = $this
    ->entityTypeManager()
    ->getStorage('bat_type_group')
    ->create([
    'type' => $type_group_bundle
      ->id(),
  ]);
  $form = $this
    ->entityFormBuilder()
    ->getForm($type);
  return $form;
}