pickupBookingsCount = $baseCount; // call parent constructor parent::__construct($bookings, $period, $interval); } /** * Increases the number of "on the books" bookings at current pickup period. * * @param int $count The number of new bookings to register. * * @return int The total number of "on the books" bookings at current pickup. */ public function registerNewBooking(int $count = 1): int { // increase counter $this->pickupBookingsCount += $count; // return the updated counter return $this->pickupBookingsCount; } /** * Decreases the number of "on the books" bookings at current pickup period. * * @param int $count The number of booking cancellations to register. * * @return int The total number of "on the books" bookings at current pickup. */ public function registerBookingCancellation(int $count = 1): int { // decrease counter $this->pickupBookingsCount -= $count; // return the updated counter return $this->pickupBookingsCount; } /** * Returns the starting bookings counter at the current pickup period. * * @return int */ public function getPickupStartingBookings(): int { return $this->pickupBookingsCount; } }