PHP Класс Roomify\Bat\Event\AbstractEvent

Наследование: implements Roomify\Bat\Event\EventInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$end_date DateTime The end date for the event. Keep in mind that BAT considers a time such as 1358 to include the entire 58th minute. So what an event that we would describe as starting at 1300 and ending at 1400 for BAT actually ends at 1359. This is because (among other reasons) there may well be another event starting at 1400 and two events next to each other cannot share the same time.
$start_date DateTime The start date for the event.
$unit The unit the event is relevant to
$unit_id integer The booking unit the event is relevant to
$value integer This can represent an availability state or a pricing value

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

Метод Описание
dateIsEarlier ( DateTime $date ) : boolean Checks if the date supplied starts earlier than our event
dateIsInRange ( DateTime $date ) : boolean Checks if date supplied is in range of event
dateIsLater ( DateTime $date ) : boolean Checks if the date supplied ends after our event ends
diff ( )
endDateToString ( $format = 'Y-m-d H:i' ) : mixed Utility function to always give us a standard format for viewing the end date.
endDay ( $format = 'j' )
endHour ( $format = 'G' )
endMinute ( $format = 'i' )
endMonth ( $format = 'n' )
endMonthDate ( DateTime $date ) {@inheritdoc)
endWeek ( $format = 'W' )
endYear ( $format = 'Y' )
endsLater ( DateTime $date ) : boolean Checks if our event ends after the date supplied
getEndDate ( ) : DateTime Returns the end date.
getStartDate ( ) : DateTime Returns the start date.
getUnitId ( ) : integer Returns the unit id.
getValue ( ) : integer Returns the value.
isFirstDay ( $date )
isFirstHour ( $date )
isFirstMonth ( $date )
isLastMonth ( $date )
isSameDay ( )
isSameHour ( )
isSameMonth ( )
isSameYear ( )
itemize ( EventItemizer $itemizer ) : array Transforms the event in a breakdown of days, hours and minutes with associated states.
overlaps ( DateTime $start, DateTime $end ) : boolean Returns true if the event overlaps at all with the time period within the start and end time.
saveEvent ( Roomify\Bat\Store\Store $store, string $granularity = AbstractEvent::BAT_HOURLY ) : boolean Saves an event using the Store object
setEndDate ( DateTime $end_date ) Set the end date.
setStartDate ( DateTime $start_date ) Set the start date.
setUnitId ( integer $unit_id ) Set the unit id.
setValue ( integer $value ) Set the value.
startDateToString ( $format = 'Y-m-d H:i' ) : mixed Utility function to always give us a standard format for viewing the start date.
startDay ( $format = 'j' )
startHour ( $format = 'G' )
startMinute ( $format = 'i' )
startMonth ( $format = 'n' )
startWeek ( $format = 'W' )
startYear ( $format = 'Y' )
startsEarlier ( DateTime $date ) : boolean Checks if our event starts earlier than the date supplied
toJson ( Roomify\Bat\EventFormatter\EventFormatter $event_formatter )

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

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

Checks if the date supplied starts earlier than our event
public dateIsEarlier ( DateTime $date ) : boolean
$date DateTime
Результат boolean

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

Checks if date supplied is in range of event
public dateIsInRange ( DateTime $date ) : boolean
$date DateTime
Результат boolean

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

Checks if the date supplied ends after our event ends
public dateIsLater ( DateTime $date ) : boolean
$date DateTime
Результат boolean

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

public diff ( )

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

Utility function to always give us a standard format for viewing the end date.
public endDateToString ( $format = 'Y-m-d H:i' ) : mixed
Результат mixed

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

public endDay ( $format = 'j' )

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

public endHour ( $format = 'G' )

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

public endMinute ( $format = 'i' )

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

public endMonth ( $format = 'n' )

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

{@inheritdoc)
public endMonthDate ( DateTime $date )
$date DateTime

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

public endWeek ( $format = 'W' )

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

public endYear ( $format = 'Y' )

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

Checks if our event ends after the date supplied
public endsLater ( DateTime $date ) : boolean
$date DateTime
Результат boolean

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

Returns the end date.
public getEndDate ( ) : DateTime
Результат DateTime

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

Returns the start date.
public getStartDate ( ) : DateTime
Результат DateTime

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

Returns the unit id.
public getUnitId ( ) : integer
Результат integer

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

Returns the value.
public getValue ( ) : integer
Результат integer

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

public isFirstDay ( $date )

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

public isFirstHour ( $date )

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

public isFirstMonth ( $date )

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

public isLastMonth ( $date )

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

public isSameDay ( )

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

public isSameHour ( )

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

public isSameMonth ( )

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

public isSameYear ( )

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

Transforms the event in a breakdown of days, hours and minutes with associated states.
public itemize ( EventItemizer $itemizer ) : array
$itemizer EventItemizer
Результат array

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

Returns true if the event overlaps at all with the time period within the start and end time.
public overlaps ( DateTime $start, DateTime $end ) : boolean
$start DateTime
$end DateTime
Результат boolean

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

Saves an event using the Store object
public saveEvent ( Roomify\Bat\Store\Store $store, string $granularity = AbstractEvent::BAT_HOURLY ) : boolean
$store Roomify\Bat\Store\Store
$granularity string
Результат boolean

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

Set the end date.
public setEndDate ( DateTime $end_date )
$end_date DateTime

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

Set the start date.
public setStartDate ( DateTime $start_date )
$start_date DateTime

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

Set the unit id.
public setUnitId ( integer $unit_id )
$unit_id integer

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

Set the value.
public setValue ( integer $value )
$value integer

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

Utility function to always give us a standard format for viewing the start date.
public startDateToString ( $format = 'Y-m-d H:i' ) : mixed
Результат mixed

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

public startDay ( $format = 'j' )

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

public startHour ( $format = 'G' )

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

public startMinute ( $format = 'i' )

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

public startMonth ( $format = 'n' )

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

public startWeek ( $format = 'W' )

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

public startYear ( $format = 'Y' )

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

Checks if our event starts earlier than the date supplied
public startsEarlier ( DateTime $date ) : boolean
$date DateTime
Результат boolean

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

public toJson ( Roomify\Bat\EventFormatter\EventFormatter $event_formatter )
$event_formatter Roomify\Bat\EventFormatter\EventFormatter

Описание свойств

$end_date защищенное свойство

The end date for the event. Keep in mind that BAT considers a time such as 1358 to include the entire 58th minute. So what an event that we would describe as starting at 1300 and ending at 1400 for BAT actually ends at 1359. This is because (among other reasons) there may well be another event starting at 1400 and two events next to each other cannot share the same time.
protected DateTime $end_date
Результат DateTime

$start_date защищенное свойство

The start date for the event.
protected DateTime $start_date
Результат DateTime

$unit защищенное свойство

The unit the event is relevant to
protected $unit

$unit_id защищенное свойство

The booking unit the event is relevant to
protected int $unit_id
Результат integer

$value защищенное свойство

This can represent an availability state or a pricing value
protected int $value
Результат integer