PHP Класс business\Business

Автор: Florian Voutzinos ([email protected])
Наследование: implements business\BusinessInterface, implements Serializable, implements JsonSerializable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( array $days, Holidays | DateTime[] | null $holidays = null, DateTimeZone $timezone = null ) Creates a new business.
closest ( DateTime $date, $mode = self::CLOSEST_NEXT )
jsonSerialize ( )
serialize ( )
timeline ( DateTime $start, DateTime $end, DateInterval $interval )
unserialize ( $serialized )
within ( DateTime $date )

Приватные методы

Метод Описание
addDay ( business\DayInterface $day ) Adds a day.
getClosestDateAfter ( DateTime $date ) : DateTime Gets the closest business date after the given date.
getClosestDateBefore ( DateTime $date ) : DateTime Gets the closest business date before the given date.
getClosestDayAfter ( integer $dayNumber ) : business\DayInterface | null Gets the closest business day after a given day number (including it).
getClosestDayBefore ( integer $dayNumber ) : business\DayInterface | null Gets the closest business day before a given day number (including it).
getDateAfter ( DateTime $date ) : DateTime Gets the business date after the given date (excluding holidays).
getDateBefore ( DateTime $date ) : DateTime Gets the business date before the given date (excluding holidays).
getDay ( integer $dayNumber ) : business\DayInterface | null Gets the day corresponding to the day number.
getDayAfter ( integer $dayNumber ) : business\DayInterface | null Gets the business day after the day number.
getDayBefore ( integer $dayNumber ) : business\DayInterface | null Gets the business day before the day number.
setDays ( array $days ) Adds a set of days.

Описание методов

__construct() публичный Метод

Creates a new business.
public __construct ( array $days, Holidays | DateTime[] | null $holidays = null, DateTimeZone $timezone = null )
$days array
$holidays Holidays | DateTime[] | null
$timezone DateTimeZone

closest() публичный Метод

public closest ( DateTime $date, $mode = self::CLOSEST_NEXT )
$date DateTime

jsonSerialize() публичный Метод

public jsonSerialize ( )

serialize() публичный Метод

public serialize ( )

timeline() публичный Метод

public timeline ( DateTime $start, DateTime $end, DateInterval $interval )
$start DateTime
$end DateTime
$interval DateInterval

unserialize() публичный Метод

public unserialize ( $serialized )

within() публичный Метод

public within ( DateTime $date )
$date DateTime