ParseUtils
in package

Tags
since
3.7.2

Table of Contents

parseAdults()  : int
parseCheckInDate()  : DateTime
parseCheckOutDate()  : DateTime
parseChildren()  : int
parseCustomer()  : array<string|int, mixed>|false
parseRooms()  : array<string|int, mixed>
parseRoom()  : array<string|int, mixed>
parseServices()  : array<string|int, mixed>

Methods

parseAdults()

public static parseAdults(array<string|int, mixed> $rawData[, array<string|int, mixed> $args = array() ]) : int
Parameters
$rawData : array<string|int, mixed>

Raw adults string.

$args : array<string|int, mixed> = array()

Optional. No args at the moment.

Tags
throws
RuntimeException
since
3.8
Return values
int

parseCheckInDate()

public static parseCheckInDate(string $rawData[, array<string|int, mixed> $args = array() ]) : DateTime
Parameters
$rawData : string

Raw check-in date string.

$args : array<string|int, mixed> = array()

Optional. @param bool $args['allow_past_dates'] Optional. FALSE by default.

Tags
throws
RuntimeException

If check-in date is not valid or earlier than today (if past dates not allowed).

since
3.8
Return values
DateTime

parseCheckOutDate()

public static parseCheckOutDate(string $rawData[, array<string|int, mixed> $args = array() ]) : DateTime
Parameters
$rawData : string

Raw check-out date string.

$args : array<string|int, mixed> = array()

Optional. @param bool $args['check_booking_rules'] Optional. TRUE by default. @param DateTime|null|false $args['check_in_date'] Optional. Check-in date to verify the booking rules (only if "check_booking_rules" is set). Not set by default (FALSE).

Tags
throws
RuntimeException
since
3.8
Return values
DateTime

parseChildren()

public static parseChildren(array<string|int, mixed> $rawData[, array<string|int, mixed> $args = array() ]) : int
Parameters
$rawData : array<string|int, mixed>

Raw children string.

$args : array<string|int, mixed> = array()

Optional. No args at the moment.

Tags
throws
RuntimeException
since
3.8
Return values
int

parseCustomer()

public static parseCustomer(array<string|int, mixed> $rawData[, array<string|int, mixed> &$errors = null ]) : array<string|int, mixed>|false
Parameters
$rawData : array<string|int, mixed>
$errors : array<string|int, mixed> = null

Optional. An array to add the errors to.

Tags
since
3.7.2
Return values
array<string|int, mixed>|false

Customer data or FALSE.

parseRooms()

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

Raw [mphb_room_details => ...] data.

$args : array<string|int, mixed>

@param DateTime $args['check_in_date'] Required if "edit_booking" is not set. @param DateTime $args['check_out_date'] Required if "edit_booking" is not set. @param bool $args['check_booking_rules'] Optional. TRUE by default. FALSE if "edit_booking" is set. @param int|int[] $args['exclude_bookings'] Optional. @param Booking $args['edit_booking'] Optional.

Tags
throws
RuntimeException
since
3.8
Return values
array<string|int, mixed>

Array of [room_id, room_type_id, rate_id, adults, children, guest_name, allowed_rates, services], where all IDs and objects - original values (not translated).

parseRoom()

protected static parseRoom(mixed $roomData, array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$roomData : mixed
$args : array<string|int, mixed>

@param DateTime $args['check_in_date'] @param DateTime $args['check_out_date'] @param bool $args['check_booking_rules']

Tags
throws
RuntimeException
since
3.8
Return values
array<string|int, mixed>

parseServices()

protected static parseServices(mixed $servicesData, array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$servicesData : mixed
$args : array<string|int, mixed>

@param RoomType $args['room_type']

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

Search results