public function BookingController::add in Booking and Availability Management Tools for Drupal 8
Provides the unit type submission form.
Parameters
\Drupal\bat_booking\BookingBundleInterface $booking_bundle: The type bundle entity for the unit type.
Return value
array A unit type submission form.
1 string reference to 'BookingController::add'
- bat_booking.routing.yml in modules/bat_booking/ bat_booking.routing.yml 
- modules/bat_booking/bat_booking.routing.yml
File
- modules/bat_booking/ src/ Controller/ BookingController.php, line 70 
- Contains \Drupal\bat_booking\Controller\BookingController.
Class
- BookingController
- Returns responses for Type routes.
Namespace
Drupal\bat_booking\ControllerCode
public function add(BookingBundleInterface $booking_bundle) {
  $type = $this
    ->entityTypeManager()
    ->getStorage('bat_booking')
    ->create([
    'type' => $booking_bundle
      ->id(),
  ]);
  $form = $this
    ->entityFormBuilder()
    ->getForm($type);
  return $form;
}