PHP Class business\Holidays

Author: Márk Sági-Kazár ([email protected])
Inheritance: implements Serializable
Exibir arquivo Open project: florianv/business Class Usage Examples

Public Methods

Method Description
__construct ( array $holidays = [] ) Creates a new holiday collection.
addHoliday ( DateTime $holiday ) Adds a day.
addHolidays ( DateTime[] | DateRange[] | DateRange $holidays ) Adds a set of days.
isHoliday ( DateTime $date ) : boolean Checks if a given date is holiday.
jsonSerialize ( )
serialize ( )
unserialize ( $serialized )

Method Details

__construct() public method

Creates a new holiday collection.
public __construct ( array $holidays = [] )
$holidays array

addHoliday() public method

Adds a day.
public addHoliday ( DateTime $holiday )
$holiday DateTime

addHolidays() public method

Adds a set of days.
public addHolidays ( DateTime[] | DateRange[] | DateRange $holidays )
$holidays DateTime[] | DateRange[] | DateRange

isHoliday() public method

Checks if a given date is holiday.
public isHoliday ( DateTime $date ) : boolean
$date DateTime
return boolean

jsonSerialize() public method

public jsonSerialize ( )

serialize() public method

public serialize ( )

unserialize() public method

public unserialize ( $serialized )