\MPorcheron\FreeBusyCalCalendar

Container for a calendar's configuration and data, this class handles a specific calendar source's configuration and event data in iCal format.

Summary

Methods
Properties
Constants
__contruct()
setUrl()
setFile()
setiCal()
fetch()
parse()
No public properties found
No constants found
No protected methods found
$iCal
N/A
No private methods found
$data
N/A

Properties

$iCal

$iCal : string

Type

string — iCal file.

$data

$data : array<mixed,mixed>

Type

array<mixed,mixed> — Configuration data.

Methods

__contruct()

__contruct() 

Create the calendar configuration with the default values.

setUrl()

setUrl(string  $url) : \MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\Calendar

Set the iCal file to parsed from an HTTP(S) or FTP address.

Parameters

string $url

iCal file to be downloaded.

Throws

\MPorcheron\FreeBusyCal\InvalidArgumentException

If the passed file is not valid or is not downloadable.

Returns

\MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\Calendar —

$this.

setFile()

setFile(string  $file) : \MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\Calendar

Set the iCal file to parsed (can be local or remote)

Parameters

string $file

iCal file to be parsed.

Throws

\MPorcheron\FreeBusyCal\InvalidArgumentException

If the passed file does not exist or is not readable.

Returns

\MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\Calendar —

$this.

setiCal()

setiCal(string  $iCal) : \MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\Calendar

Set the iCal data to parsed. Note: no validation occurs!

Parameters

string $iCal

iCal data to be parsed.

Returns

\MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\Calendar —

$this.

fetch()

fetch(array<mixed,mixed>  $config, boolean  $refetch = false) : \MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\Calendar

Fetch the iCal file needed to generate the availability calendar.

Parameters

array<mixed,mixed> $config

Configuration data.

boolean $refetch

Refetch iCal data if it has already been fetched once.

Throws

\BadFunctionCallException

If the iCal data hasn't been fetched/set yet.

Returns

\MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\Calendar —

$this.

parse()

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

Parse the iCal file needed to generate the availability calendar.

Parameters

array<mixed,mixed> $config

Configuration data.

Throws

\BadFunctionCallException

If the iCal data hasn't been fetched/set yet.

Returns

\MPorcheron\FreeBusyCal\MPorcheron\FreeBusyCal\FreeBusyCalendar —

Availability for the calendar.