Booking
extends AbstractUniqueEntity
in package
Tags
Table of Contents
- $customer : Customer
- $customerNotes : string
- $id : int
- $reservations : array<string|int, Reservation>
- $status : string
- $totalPrice : float
- $uid : string
- Unique identifier. Most likely is UUID v4.
- $couponId : int
- __construct() : mixed
- addLog() : int|false
- expectPayment() : mixed
- getCoupon() : Coupon|null
- getCouponId() : int
- getCustomer() : Customer
- getEmployeeIds() : array<string|int, int>
- getEmployees() : array<string|int, mixed>
- getExpectingPayment() : Payment|null
- getExpectingPaymentId() : int
- getId() : int
- getLocationIds() : array<string|int, int>
- getLocations() : array<string|int, mixed>
- getLogs() : array<string|int, WP_Comment>
- getPaidPrice() : float
- getPayments() : array<string|int, Payment>
- getReservations() : array<string|int, Reservation>
- getServiceIds() : array<string|int, int>
- getServices() : array<string|int, mixed>
- getToPayPrice() : float
- getTotalPrice() : float
- getUid() : string
- hasCoupon() : bool
- isAdminBooking() : bool
- isConfirmed() : bool
- isExpectsPayment() : bool
- mapReservations() : array<string|int, mixed>
- setCouponId() : mixed
- getLinkedEntities() : array<string|int, mixed>
- setupFields() : mixed
Properties
$customer
public
Customer
$customer
= null
Tags
$customerNotes
public
string
$customerNotes
= ''
Tags
$id
public
int
$id
= 0
Tags
$reservations
public
array<string|int, Reservation>
$reservations
= []
Tags
$status
public
string
$status
= 'new'
Tags
$totalPrice
public
float
$totalPrice
= 0.0
Tags
$uid
Unique identifier. Most likely is UUID v4.
public
string
$uid
= ''
Tags
$couponId
protected
int
$couponId
= 0
Tags
Methods
__construct()
public
__construct(int $id[, array<string|int, mixed> $fieldValues = [] ]) : mixed
Parameters
- $id : int
- $fieldValues : array<string|int, mixed> = []
-
Optional.
Tags
Return values
mixed —addLog()
public
addLog(string $message[, int|null $authorId = null ]) : int|false
Parameters
- $message : string
- $authorId : int|null = null
-
Optional. Current logged in user ID by default.
Tags
Return values
int|false —The new comment's ID on success, false on failure.
expectPayment()
public
expectPayment(Payment|int $payment) : mixed
Parameters
- $payment : Payment|int
Tags
Return values
mixed —getCoupon()
public
getCoupon() : Coupon|null
Tags
Return values
Coupon|null —getCouponId()
public
getCouponId() : int
Tags
Return values
int —getCustomer()
public
getCustomer() : Customer
Tags
Return values
Customer —getEmployeeIds()
public
getEmployeeIds() : array<string|int, int>
Tags
Return values
array<string|int, int> —getEmployees()
public
getEmployees([array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed> = []
-
Optional.
Tags
Return values
array<string|int, mixed> —getExpectingPayment()
public
getExpectingPayment() : Payment|null
Tags
Return values
Payment|null —getExpectingPaymentId()
public
getExpectingPaymentId() : int
Tags
Return values
int —getId()
public
getId() : int
Tags
Return values
int —getLocationIds()
public
getLocationIds() : array<string|int, int>
Tags
Return values
array<string|int, int> —getLocations()
public
getLocations([array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed> = []
-
Optional.
Tags
Return values
array<string|int, mixed> —getLogs()
public
getLogs() : array<string|int, WP_Comment>
Tags
Return values
array<string|int, WP_Comment> —Logs in descending order.
getPaidPrice()
public
getPaidPrice() : float
Tags
Return values
float —getPayments()
public
getPayments() : array<string|int, Payment>
Tags
Return values
array<string|int, Payment> —getReservations()
public
getReservations() : array<string|int, Reservation>
Tags
Return values
array<string|int, Reservation> —getServiceIds()
public
getServiceIds() : array<string|int, int>
Tags
Return values
array<string|int, int> —getServices()
public
getServices([array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed> = []
-
Optional.
Tags
Return values
array<string|int, mixed> —getToPayPrice()
public
getToPayPrice() : float
Tags
Return values
float —getTotalPrice()
public
getTotalPrice() : float
Tags
Return values
float —getUid()
public
getUid() : string
Tags
Return values
string —hasCoupon()
public
hasCoupon() : bool
Tags
Return values
bool —isAdminBooking()
public
isAdminBooking() : bool
Tags
Return values
bool —isConfirmed()
public
isConfirmed() : bool
Tags
Return values
bool —isExpectsPayment()
public
isExpectsPayment(Payment|int $payment) : bool
Parameters
- $payment : Payment|int
Tags
Return values
bool —mapReservations()
public
mapReservations(string $propertyName) : array<string|int, mixed>
Parameters
- $propertyName : string
Tags
Return values
array<string|int, mixed> —setCouponId()
public
setCouponId(int $couponId) : mixed
Parameters
- $couponId : int
Tags
Return values
mixed —getLinkedEntities()
protected
getLinkedEntities(array<string|int, int> $ids, array<string|int, mixed> $args, string $getCallback) : array<string|int, mixed>
Parameters
- $ids : array<string|int, int>
- $args : array<string|int, mixed>
- $getCallback : string
Tags
Return values
array<string|int, mixed> —setupFields()
protected
setupFields( $fieldValues) : mixed