\MPorcheron\FreeBusyCalFreeBusyCalendar

Calendar of a person's free/busy calendar (either one calendar or multiple). This contains the details for a person's availability.

Summary

Methods
Properties
Constants
__construct()
setConfig()
getCalendarDates()
getCalendarTimes()
isFree()
merge()
No public properties found
DATE_FORMAT
TIME_FORMAT
No protected methods found
No protected properties found
N/A
doMerge()
$config
N/A

Constants

DATE_FORMAT

DATE_FORMAT

TIME_FORMAT

TIME_FORMAT

Properties

$config

$config : array<mixed,mixed>

Type

array<mixed,mixed> — Configuration data.

Methods

__construct()

__construct(mixed  $input = array(), integer  $flags,   $iterator_class = 'ArrayIterator') 

Construct the availability matrix.

Parameters

mixed $input

The input parameter accepts an array or an Object.

integer $flags

Flags to control the behaviour of the ArrayObject object.

$iterator_class

setConfig()

setConfig(array<mixed,mixed>  $config) : \MPorcheron\FreeBusyCal\FreeBusyCalendar

Set the configuration values to be used in the generation of the representation of the calendar.

Parameters

array<mixed,mixed> $config

Configuration dats.

Returns

\MPorcheron\FreeBusyCal\FreeBusyCalendar

$this.

getCalendarDates()

getCalendarDates(string  $format = self::DATE_FORMAT) : array<mixed,string>

Retrieve the values labels for the calendar dates to be displayed.

Parameters

string $format

PHP date format the dates to be displayed.

Returns

array<mixed,string> —

Array of the calendar dates to be displayed.

getCalendarTimes()

getCalendarTimes(string  $format = self::TIME_FORMAT) : array<mixed,string>

Retrieve the values labels for the calendar times to be displayed. At the moment, only hours are supported.

Parameters

string $format

PHP date format the times to be displayed.

Returns

array<mixed,string> —

Array of the calendar times to be displayed. [YYYY-mm-dd][hour][minute] => [current time formatted, next time formatted]

isFree()

isFree(string  $date, string  $hour, string  $minute) : boolean

Determine if we are available at a given time.

Parameters

string $date

Date to check if available in YYYY-mm-dd format.

string $hour

Hour to check if available.

string $minute

Minute to check if available.

Throws

\OutOfBoundsException

If the queried date or time is out of the given calendar range.

\BadFunctionCallException

If the calendar hasn't been fetched yet.

Returns

boolean —

true if available, false otherwise.

merge()

merge(\MPorcheron\FreeBusyCal\FreeBusyCalendar  $cal) 

Merge availability data. If busy, will remain busy.

Parameters

\MPorcheron\FreeBusyCal\FreeBusyCalendar $cal

Availability matrix to merge.

doMerge()

doMerge(array<mixed,mixed>  $arr) 

Merge availability data. If busy, will remain busy.

Parameters

array<mixed,mixed> $arr

Array of availability to merge.