CustomRules
in package
implements
RuleVerifyInterface
Interfaces, Classes and Traits
Table of Contents
- $list : array<string|int, CustomRule>
- $globals : array<string|int, CustomRule>
- $rules : array<string|int, mixed>
- Also <b>contains</b> global rules.
- __construct() : mixed
- filter() : array<string|int, mixed>
- getBlockedRoomsCounts() : mixed
- getCommentsByDates() : array<string|int, mixed>
- getGlobalRestrictions() : array<string|int, mixed>
- getGlobalTypeRestrictions() : array<string|int, mixed>
- getUnavailableRooms() : array<string|int, int>
- getUnavailableRoomsCount() : int
- verify() : bool
- verifyNotCheckInRestriction() : mixed
- verifyNotCheckOutRestriction() : mixed
- verifyNotStayInRestriction() : mixed
- getGlobalRulesForRoomTypeId() : mixed
- mergeRestrictions() : array<string|int, mixed>
Properties
$list
protected
array<string|int, CustomRule>
$list
= array()
$globals
private
array<string|int, CustomRule>
$globals
= array()
$rules
Also <b>contains</b> global rules.
private
array<string|int, mixed>
$rules
= array()
Methods
__construct()
public
__construct(mixed $customRules) : mixed
Parameters
- $customRules : mixed
Tags
Return values
mixed —filter()
public
filter(array<string|int, mixed> $atts) : array<string|int, mixed>
Parameters
- $atts : array<string|int, mixed>
Return values
array<string|int, mixed> —[[roomTypeId, roomId, startDate, endDate, comment]] (roomTypeId and roomId of the rule, not the attributes)
getBlockedRoomsCounts()
public
getBlockedRoomsCounts(mixed $roomTypeId) : mixed
Parameters
- $roomTypeId : mixed
Return values
mixed —getCommentsByDates()
public
getCommentsByDates(int $typeId, array<string|int, mixed> $roomIds) : array<string|int, mixed>
Parameters
- $typeId : int
-
Booking Calendar queries only original types.
- $roomIds : array<string|int, mixed>
Return values
array<string|int, mixed> —getGlobalRestrictions()
public
getGlobalRestrictions() : array<string|int, mixed>
Return values
array<string|int, mixed> —["2017-01-01" => ["not_check_in" => true, "not_check_out" => true, "not_stay_in" => true], ...]
getGlobalTypeRestrictions()
public
getGlobalTypeRestrictions() : array<string|int, mixed>
Return values
array<string|int, mixed> —["2017-01-01" => ["not_check_in" => true, "not_check_out" => true, "not_stay_in" => true], ...]
getUnavailableRooms()
public
getUnavailableRooms(DateTime $checkIn, DateTime $checkOut, int $typeId) : array<string|int, int>
Parameters
- $checkIn : DateTime
- $checkOut : DateTime
- $typeId : int
Return values
array<string|int, int> —getUnavailableRoomsCount()
public
getUnavailableRoomsCount(DateTime $checkIn, DateTime $checkOut, int $typeId) : int
Parameters
- $checkIn : DateTime
- $checkOut : DateTime
- $typeId : int
Return values
int —verify()
public
verify(DateTime $checkIn, DateTime $checkOut, int $typeId) : bool
Parameters
- $checkIn : DateTime
- $checkOut : DateTime
- $typeId : int
-
Optional. 0 by default. Already translated in RulesChecker.
Return values
bool —verifyNotCheckInRestriction()
public
verifyNotCheckInRestriction(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
- $checkInDate : DateTime
- $checkOutDate : DateTime
- $roomTypeId : mixed
Return values
mixed —verifyNotCheckOutRestriction()
public
verifyNotCheckOutRestriction(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
- $checkInDate : DateTime
- $checkOutDate : DateTime
- $roomTypeId : mixed
Return values
mixed —verifyNotStayInRestriction()
public
verifyNotStayInRestriction(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
- $checkInDate : DateTime
- $checkOutDate : DateTime
- $roomTypeId : mixed
Return values
mixed —getGlobalRulesForRoomTypeId()
private
getGlobalRulesForRoomTypeId(mixed $roomTypeId) : mixed
Parameters
- $roomTypeId : mixed
Return values
mixed —mergeRestrictions()
private
mergeRestrictions(array<string|int, mixed> $dates1, array<string|int, mixed> $dates2) : array<string|int, mixed>
Parameters
- $dates1 : array<string|int, mixed>
-
[%date% => %restrictions%]
- $dates2 : array<string|int, mixed>
-
[%date% => %restrictions%]
Return values
array<string|int, mixed> —[%date% => %merged restrictions%]