code: protected function loadInventory($inventory)
      {
          if (is_array($inventory) && count($inventory) > 0) {
              $this->inventory = new Inventory();
  
              foreach ($inventory as $bookingClass => $availabilityAmount) {
                  $this->inventory->bookingClassDetails[] = new BookingClassDetails(
                      $bookingClass,
                      $availabilityAmount
                  );
              }
          }
      }
docs: Load inventory information
  
  @param array $inventory