ReservationRules
in package
implements RuleVerifyInterface

Interfaces, Classes and Traits

RuleVerifyInterface

Table of Contents

RULE_CHECK_IN  = 'check_in_days'
RULE_CHECK_OUT  = 'check_out_days'
RULE_MAX_ADVANCE  = 'max_advance_reservation'
RULE_MAX_STAY  = 'max_stay_length'
RULE_MIN_ADVANCE  = 'min_advance_reservation'
RULE_MIN_STAY  = 'min_stay_length'
$rules  : array<string|int, ReservationRulesList>
__construct()  : mixed
ReservationRules constructor.
getData()  : array<string|int, mixed>
getMaxStayLengthReservationDaysCount()  : mixed
getMinDaysAllSeason()  : int
getMinStayLengthReservationDaysCount()  : mixed
verify()  : bool
verifyCheckInDaysReservationRule()  : mixed
verifyCheckOutDaysReservationRule()  : mixed
verifyMaxAdvanceReservationRule()  : mixed
verifyMaxStayLengthReservationRule()  : mixed
verifyMinAdvanceReservationRule()  : mixed
verifyMinStayLengthReservationRule()  : mixed
cleanEmptyRules()  : mixed
Delete rules that not applied at least to one season and at least to one room.
fillFallbackRules()  : mixed
Fill fallback default rules
verifyRule()  : mixed

Constants

RULE_CHECK_IN

public mixed RULE_CHECK_IN = 'check_in_days'

RULE_CHECK_OUT

public mixed RULE_CHECK_OUT = 'check_out_days'

RULE_MAX_ADVANCE

public mixed RULE_MAX_ADVANCE = 'max_advance_reservation'

RULE_MAX_STAY

public mixed RULE_MAX_STAY = 'max_stay_length'

RULE_MIN_ADVANCE

public mixed RULE_MIN_ADVANCE = 'min_advance_reservation'

RULE_MIN_STAY

public mixed RULE_MIN_STAY = 'min_stay_length'

Properties

$rules

private array<string|int, ReservationRulesList> $rules = array(self::RULE_CHECK_IN => null, self::RULE_CHECK_OUT => null, self::RULE_MIN_STAY => null, self::RULE_MAX_STAY => null, self::RULE_MIN_ADVANCE => null, self::RULE_MAX_ADVANCE => null)

Methods

__construct()

ReservationRules constructor.

public __construct(array<string|int, mixed> $rules) : mixed
Parameters
$rules : array<string|int, mixed>
Tags
since
3.9.9
  • reset rules to default values if using for admin is disabled
Return values
mixed

getData()

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

getMaxStayLengthReservationDaysCount()

public getMaxStayLengthReservationDaysCount(DateTime $checkInDate, mixed $roomTypeId) : mixed
Parameters
$checkInDate : DateTime
$roomTypeId : mixed
Return values
mixed

getMinDaysAllSeason()

public getMinDaysAllSeason( $roomTypeId) : int
Parameters
$roomTypeId :
Return values
int

getMinStayLengthReservationDaysCount()

public getMinStayLengthReservationDaysCount(DateTime $checkInDate, mixed $roomTypeId) : mixed
Parameters
$checkInDate : DateTime
$roomTypeId : mixed
Return values
mixed

verify()

public verify(DateTime $checkInDate, DateTime $checkOutDate, int $roomTypeId) : bool
Parameters
$checkInDate : DateTime
$checkOutDate : DateTime
$roomTypeId : int
Return values
bool

verifyCheckInDaysReservationRule()

public verifyCheckInDaysReservationRule(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
$checkInDate : DateTime
$checkOutDate : DateTime
$roomTypeId : mixed
Return values
mixed

verifyCheckOutDaysReservationRule()

public verifyCheckOutDaysReservationRule(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
$checkInDate : DateTime
$checkOutDate : DateTime
$roomTypeId : mixed
Return values
mixed

verifyMaxAdvanceReservationRule()

public verifyMaxAdvanceReservationRule(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
$checkInDate : DateTime
$checkOutDate : DateTime
$roomTypeId : mixed
Return values
mixed

verifyMaxStayLengthReservationRule()

public verifyMaxStayLengthReservationRule(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
$checkInDate : DateTime
$checkOutDate : DateTime
$roomTypeId : mixed
Return values
mixed

verifyMinAdvanceReservationRule()

public verifyMinAdvanceReservationRule(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
$checkInDate : DateTime
$checkOutDate : DateTime
$roomTypeId : mixed
Return values
mixed

verifyMinStayLengthReservationRule()

public verifyMinStayLengthReservationRule(DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
$checkInDate : DateTime
$checkOutDate : DateTime
$roomTypeId : mixed
Return values
mixed

cleanEmptyRules()

Delete rules that not applied at least to one season and at least to one room.

private cleanEmptyRules( &$rules) : mixed
Parameters
$rules :
Return values
mixed

fillFallbackRules()

Fill fallback default rules

private fillFallbackRules(array<string|int, mixed> &$rules) : mixed
Parameters
$rules : array<string|int, mixed>
Return values
mixed

verifyRule()

private verifyRule( $ruleType, DateTime $checkInDate, DateTime $checkOutDate, mixed $roomTypeId) : mixed
Parameters
$ruleType :

one of constant in this class

$checkInDate : DateTime
$checkOutDate : DateTime
$roomTypeId : mixed
Return values
mixed

Search results