Booking
in package

Table of Contents

$priceBreakdown  : mixed
$syncId  : string
Identifies the source calendar of the imported booking. "Outdated" for all bookings imported before v3.4.0.
$syncQueueId  : int
In which queue we imported this booking.
$checkInDate  : DateTime
$checkOutDate  : DateTime
$checkoutId  : string
32-character UUID4 string.
$couponId  : int
$customer  : Customer
$dateTime  : DateTime
$iCalDescription  : string
$iCalProdid  : string
$iCalSummary  : string
$id  : int
$internalNotes  : mixed
$language  : string
Language of customer
$note  : string
$reservedRooms  : array<string|int, ReservedRoom>
$status  : string
$totalPrice  : float
__construct()  : mixed
addLog()  : mixed
applyCoupon()  : bool|WP_Error
calcDepositAmount()  : float
calcPrice()  : float
create()  : mixed
deleteExpiration()  : mixed
Delete expiration time of pending confirmation for booking.
generateKey()  : mixed
getCheckInDate()  : DateTime
getCheckOutDate()  : DateTime
getCheckoutId()  : string
getCouponCode()  : string
getCouponId()  : int
getCustomer()  : Customer
getDates()  : array<string|int, mixed>
getDateTime()  : mixed
getExpectPaymentId()  : int|false
getICalDescription()  : string|null
getICalProdid()  : string
getICalSummary()  : string|null
getId()  : int
getInternalNotes()  : mixed
getKey()  : string
getLanguage()  : string
Retrieve language of customer
getLastPriceBreakdown()  : array<string|int, mixed>|null
getLogs()  : mixed
getNote()  : string
getPriceBreakdown()  : array<string|int, mixed>
Calculates new price breakdown from scratch.
getReservedRoomIds()  : array<string|int, int>
getReservedRooms()  : array<string|int, ReservedRoom>
getRoomIds()  : array<string|int, int>
getStatus()  : string
getSyncId()  : mixed
getSyncQueueId()  : mixed
getTotalPrice()  : float
isExpectPayment()  : bool
isImported()  : bool
isPending()  : bool
retrieveExpiration()  : int
Retrieve expiration time for booking in UTC.
setCustomer()  : mixed
setDates()  : mixed
Note: you need to call updateTotal() manually when all changes are done.
setExpectPayment()  : mixed
setId()  : mixed
setRooms()  : mixed
Note: you need to call updateTotal() manually when all changes are done.
setStatus()  : mixed
updateExpiration()  : mixed
Set expiration time of pending confirmation for booking
updateTotal()  : mixed
setupParameters()  : mixed

Properties

$priceBreakdown

protected mixed $priceBreakdown = []

$syncId

Identifies the source calendar of the imported booking. "Outdated" for all bookings imported before v3.4.0.

protected string $syncId = ''
Tags
see
Task

MB-906.

$syncQueueId

In which queue we imported this booking.

protected int $syncQueueId = 0

$checkInDate

private DateTime $checkInDate

$checkOutDate

private DateTime $checkOutDate

$checkoutId

32-character UUID4 string.

private string $checkoutId = ''

Used only on booking step of checkout shortcode. When user submits data (and creates booking with "pending" status) and then clicks "Back" button in browser, we can use this ID to find already created booking to merge it's data with the new one and let the user to proceed to payment again. When checkout is finished, checkoutId have not any usage.

Tags
see
Task

MB-573.

$couponId

private int $couponId

$customer

private Customer $customer

$dateTime

private DateTime $dateTime

$iCalDescription

private string $iCalDescription = ''

$iCalProdid

private string $iCalProdid = ''

$iCalSummary

private string $iCalSummary = ''

$id

private int $id

$internalNotes

private mixed $internalNotes

$language

Language of customer

private string $language

$note

private string $note

$reservedRooms

private array<string|int, ReservedRoom> $reservedRooms = array()

$status

private string $status

$totalPrice

private float $totalPrice = 0.0

Methods

__construct()

public __construct(array<string|int, mixed> $atts) : mixed
Parameters
$atts : array<string|int, mixed>
Return values
mixed

addLog()

public addLog(string $message[, int $author = null ]) : mixed
Parameters
$message : string
$author : int = null
Return values
mixed

applyCoupon()

public applyCoupon(AbstractCoupon $coupon) : bool|WP_Error
Parameters
$coupon : AbstractCoupon
Return values
bool|WP_Error

calcDepositAmount()

public calcDepositAmount([float|null $total = null ]) : float
Parameters
$total : float|null = null
Tags
since
3.8.3

Added new filter - "mphb_booking_deposit_price".

Return values
float

calcPrice()

public calcPrice() : float
Return values
float

create()

public static create(array<string|int, mixed> $atts) : mixed
Parameters
$atts : array<string|int, mixed>
Return values
mixed

deleteExpiration()

Delete expiration time of pending confirmation for booking.

public deleteExpiration(string $type) : mixed
Parameters
$type : string

Possible types: user, payment.

Return values
mixed

generateKey()

public generateKey() : mixed
Return values
mixed

getCheckInDate()

public getCheckInDate() : DateTime
Return values
DateTime

getCheckOutDate()

public getCheckOutDate() : DateTime
Return values
DateTime

getCheckoutId()

public getCheckoutId() : string
Return values
string

getCouponCode()

public getCouponCode() : string
Return values
string

getCouponId()

public getCouponId() : int
Return values
int

getCustomer()

public getCustomer() : Customer
Return values
Customer

getDates()

public getDates([mixed $fromToday = false ]) : array<string|int, mixed>
Parameters
$fromToday : mixed = false
Return values
array<string|int, mixed>

of dates where key is date in 'Y-m-d' format and value is date in frontend date format

getDateTime()

public getDateTime() : mixed
Tags
since
3.9.7
Return values
mixed

getExpectPaymentId()

public getExpectPaymentId() : int|false
Tags
since
3.6.1
Return values
int|false

Payment ID or FALSE if the booking does not expect any payment.

getICalDescription()

public getICalDescription() : string|null
Return values
string|null

getICalProdid()

public getICalProdid() : string
Return values
string

getICalSummary()

public getICalSummary() : string|null
Return values
string|null

getId()

public getId() : int
Return values
int

getInternalNotes()

public getInternalNotes() : mixed
Tags
since
3.9.3
Return values
mixed

getKey()

public getKey() : string
Return values
string

getLanguage()

Retrieve language of customer

public getLanguage() : string
Return values
string

getLastPriceBreakdown()

public getLastPriceBreakdown([ $load = true ]) : array<string|int, mixed>|null
Parameters
$load : = true

Optional. Load from post metas if not set. TRUE by default.

Tags
since
3.5.1
since
3.7.1

added optional parameter $load.

Return values
array<string|int, mixed>|null

getLogs()

public getLogs() : mixed
Return values
mixed

getNote()

public getNote() : string
Return values
string

getPriceBreakdown()

Calculates new price breakdown from scratch.

public getPriceBreakdown() : array<string|int, mixed>
Return values
array<string|int, mixed>

getReservedRoomIds()

public getReservedRoomIds() : array<string|int, int>
Tags
since
3.8
Return values
array<string|int, int>

getReservedRooms()

public getReservedRooms() : array<string|int, ReservedRoom>
Return values
array<string|int, ReservedRoom>

getRoomIds()

public getRoomIds() : array<string|int, int>
Tags
since
3.8
Return values
array<string|int, int>

getStatus()

public getStatus() : string
Return values
string

getSyncId()

public getSyncId() : mixed
Tags
since
3.4.0
Return values
mixed

getSyncQueueId()

public getSyncQueueId() : mixed
Tags
since
3.4.0
Return values
mixed

getTotalPrice()

public getTotalPrice() : float
Return values
float

isExpectPayment()

public isExpectPayment(int $paymentId) : bool
Parameters
$paymentId : int
Return values
bool

isImported()

public isImported() : bool
Tags
since
3.4.0
Return values
bool

isPending()

public isPending() : bool
Tags
since
4.2.2
Return values
bool

retrieveExpiration()

Retrieve expiration time for booking in UTC.

public retrieveExpiration(string $type) : int
Parameters
$type : string

Possible types: user, payment.

Return values
int

setCustomer()

public setCustomer(Customer $customer) : mixed
Parameters
$customer : Customer
Return values
mixed

setDates()

Note: you need to call updateTotal() manually when all changes are done.

public setDates(DateTime $checkInDate, DateTime $checkOutDate) : mixed
Parameters
$checkInDate : DateTime
$checkOutDate : DateTime
Tags
since
3.8
Return values
mixed

setExpectPayment()

public setExpectPayment(int $paymentId) : mixed
Parameters
$paymentId : int
Return values
mixed

setId()

public setId(int $id) : mixed
Parameters
$id : int
Return values
mixed

setRooms()

Note: you need to call updateTotal() manually when all changes are done.

public setRooms(array<string|int, ReservedRoom$rooms) : mixed
Parameters
$rooms : array<string|int, ReservedRoom>
Tags
since
3.8
Return values
mixed

setStatus()

public setStatus(string $status) : mixed
Parameters
$status : string
Return values
mixed

updateExpiration()

Set expiration time of pending confirmation for booking

public updateExpiration(string $type, int $expirationTime) : mixed
Parameters
$type : string

Possible types: user, payment.

$expirationTime : int
Return values
mixed

updateTotal()

public updateTotal() : mixed
Return values
mixed

setupParameters()

protected setupParameters([array<string|int, mixed> $atts = array() ]) : mixed
Parameters
$atts : array<string|int, mixed> = array()
Return values
mixed

Search results