You are here

public function BookingForm::updateStatus in Booking and Availability Management Tools for Drupal 8

Entity builder updating the unit type status with the submitted value.

Parameters

string $entity_type_id: The entity type identifier.

\Drupal\bat_booking\BookingInterface $booking_type: The unit type updated with the submitted values.

array $form: The complete form array.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

File

modules/bat_booking/src/Entity/Form/BookingForm.php, line 219
Contains \Drupal\bat_booking\Entity\Form\BookingForm.

Class

BookingForm
Form controller for Unit type edit forms.

Namespace

Drupal\bat_booking\Entity\Form

Code

public function updateStatus($entity_type_id, BookingInterface $booking_type, array $form, FormStateInterface $form_state) {
  $element = $form_state
    ->getTriggeringElement();
  if (isset($element['#published_status'])) {
    $booking_type
      ->setStatus($element['#published_status']);
  }
}