BookingUtils
in package

Table of Contents

calcDepositPrice()  : float
Calculates deposit price for booked services.
calcTotalPrice()  : float
Calculates new price for actual data (reservations, coupons etc.).
excludeBookingReservationsHandler()  : array<string|int, mixed>
isStillAvailableTimeSlots()  : bool
recalculateTotalPrice()  : mixed
Calculates and saves the new price (including coupon discount).
excludeCurrentBookingReservations()  : void
isStillAvailableTimeSlot()  : bool

Methods

calcDepositPrice()

Calculates deposit price for booked services.

public static calcDepositPrice(Booking $booking) : float
Parameters
$booking : Booking
Tags
todo

better move the calculation of coupons into an independent function. It is possible to move the coupon calculation from the static::calcTotalPrice() method into a separate method and use it in the current method.

Return values
float

calcTotalPrice()

Calculates new price for actual data (reservations, coupons etc.).

public static calcTotalPrice(Booking $booking) : float
Parameters
$booking : Booking
Return values
float

excludeBookingReservationsHandler()

public static excludeBookingReservationsHandler(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

get_posts() search parameters

Tags
since
1.15.2
protected
Return values
array<string|int, mixed>

isStillAvailableTimeSlots()

public static isStillAvailableTimeSlots(Booking $booking) : bool
Parameters
$booking : Booking
Tags
since
1.15.2
Return values
bool

recalculateTotalPrice()

Calculates and saves the new price (including coupon discount).

public static recalculateTotalPrice(Booking $booking) : mixed
Parameters
$booking : Booking
Return values
mixed

excludeCurrentBookingReservations()

protected static excludeCurrentBookingReservations(Booking $booking) : void
Parameters
$booking : Booking
Tags
since
1.15.2
Return values
void

isStillAvailableTimeSlot()

protected static isStillAvailableTimeSlot(Reservation $reservation) : bool
Parameters
$reservation : Reservation
Tags
since
1.15.2
Return values
bool

Search results