PHP 클래스 ICal\ICal

파일 보기 프로젝트 열기: johngrogg/ics-parser 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$cal array The parsed calendar
$defaultSpan integer The value in years to use for indefinite, recurring events
$defaultWeekStart
$eventCount integer How many events are in this iCal?
$freebusyCount integer How many freebusy are in this iCal?
$todoCount integer How many ToDos are in this iCal?

보호된 프로퍼티들

프로퍼티 타입 설명
$alteredRecurrenceInstances array Event recurrence instances that have been altered
$dayOrdinals
$frequencyConversion
$monthNames
$weekdays

공개 메소드들

메소드 설명
__construct ( mixed $filename = false, mixed $weekStart = false ) : void Creates the iCal Object
calendarDescription ( ) : calendar Returns the calendar description
calendarName ( ) : string Returns the calendar name
calendarTimeZone ( ) : calendar Returns the calendar timezone
events ( ) : array Returns an array of EventObjects. Every event is a class with the event details being properties within it.
eventsFromInterval ( string $interval ) : array Returns a sorted array of the events following a given string, or false if no events exist in the range.
eventsFromRange ( string $rangeStart = false, string $rangeEnd = false ) : array Returns a sorted array of the events in a given range, or false if no events exist in the range.
freeBusyEvents ( ) : array Returns an array of arrays with all free/busy events. Every event is an associative array and each property is an element it.
hasEvents ( ) : boolean Returns a boolean value whether the current calendar has events or not
iCalDateToUnixTimestamp ( string $icalDate ) : integer Return Unix timestamp from iCal date time format
iCalDateWithTimeZone ( array $event, string $key ) : string Return a date adapted to the calendar timezone depending on the event TZID
initLines ( array $lines ) : ICal Initialises lines from file
initString ( string $contents ) : ICal Initialises lines from a string
initURL ( string $url ) : ICal Initialises lines from a URL
isValidTimeZoneId ( string $timezone ) : boolean Check if a timezone is valid
processDateConversions ( ) : void Processes date conversions using the timezone
processEvents ( ) : void Performs some admin tasks on all events as taken straight from the ics file.
processRecurrences ( ) : void Processes recurrence rules
sortEventsWithOrder ( array $events, integer $sortOrder = SORT_ASC ) : sorted Sort events based on a given sort order

보호된 메소드들

메소드 설명
addCalendarComponentWithKeyAndValue ( string $component, string | boolean $keyword, string $value ) : void Add to $this->ical array one value and key.
keyValueFromString ( string $text ) : array Get a key-value pair of a string.

메소드 상세

__construct() 공개 메소드

Creates the iCal Object
public __construct ( mixed $filename = false, mixed $weekStart = false ) : void
$filename mixed The path to the iCal-file or an array of lines from an iCal file
$weekStart mixed The default first day of the week (SU or MO, etc.)
리턴 void or false if no filename is provided

addCalendarComponentWithKeyAndValue() 보호된 메소드

Add to $this->ical array one value and key.
protected addCalendarComponentWithKeyAndValue ( string $component, string | boolean $keyword, string $value ) : void
$component string This could be VTODO, VEVENT, VCALENDAR, ...
$keyword string | boolean The keyword, for example DTSTART
$value string The value, for example 20110105T090000Z
리턴 void

calendarDescription() 공개 메소드

Returns the calendar description
public calendarDescription ( ) : calendar
리턴 calendar description

calendarName() 공개 메소드

Returns the calendar name
public calendarName ( ) : string
리턴 string

calendarTimeZone() 공개 메소드

Returns the calendar timezone
public calendarTimeZone ( ) : calendar
리턴 calendar timezone

events() 공개 메소드

Returns an array of EventObjects. Every event is a class with the event details being properties within it.
public events ( ) : array
리턴 array of EventObjects

eventsFromInterval() 공개 메소드

Returns a sorted array of the events following a given string, or false if no events exist in the range.
public eventsFromInterval ( string $interval ) : array
$interval string
리턴 array of EventObjects

eventsFromRange() 공개 메소드

Events will be returned if the start or end date is contained within the range (inclusive), or if the event starts before and end after the range. If a start date is not specified or of a valid format, then the start of the range will default to the current time and date of the server. If an end date is not specified or of a valid format, the the end of the range will default to the current time and date of the server, plus 20 years. Note that this function makes use of UNIX timestamps. This might be a problem for events on, during, or after January the 29th, 2038. See http://en.wikipedia.org/wiki/Unix_time#Representing_the_number
public eventsFromRange ( string $rangeStart = false, string $rangeEnd = false ) : array
$rangeStart string Start date of the search range.
$rangeEnd string End date of the search range.
리턴 array of EventObjects

freeBusyEvents() 공개 메소드

Returns an array of arrays with all free/busy events. Every event is an associative array and each property is an element it.
public freeBusyEvents ( ) : array
리턴 array

hasEvents() 공개 메소드

Returns a boolean value whether the current calendar has events or not
public hasEvents ( ) : boolean
리턴 boolean

iCalDateToUnixTimestamp() 공개 메소드

Return Unix timestamp from iCal date time format
public iCalDateToUnixTimestamp ( string $icalDate ) : integer
$icalDate string A Date in the format YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS or TZID=Timezone:YYYYMMDD[T]HHMMSS
리턴 integer

iCalDateWithTimeZone() 공개 메소드

Return a date adapted to the calendar timezone depending on the event TZID
public iCalDateWithTimeZone ( array $event, string $key ) : string
$event array an event
$key string an event parameter (DTSTART or DTEND)
리턴 string Ymd\THis date

initLines() 공개 메소드

Initialises lines from file
public initLines ( array $lines ) : ICal
$lines array The lines to initialise
리턴 ICal

initString() 공개 메소드

Initialises lines from a string
public initString ( string $contents ) : ICal
$contents string The contents of the ical file to initialise
리턴 ICal

initURL() 공개 메소드

Initialises lines from a URL
public initURL ( string $url ) : ICal
$url string The url of the ical file to download and initialise
리턴 ICal

isValidTimeZoneId() 공개 메소드

Check if a timezone is valid
public isValidTimeZoneId ( string $timezone ) : boolean
$timezone string A timezone
리턴 boolean

keyValueFromString() 보호된 메소드

Get a key-value pair of a string.
protected keyValueFromString ( string $text ) : array
$text string which is like "VCALENDAR:Begin" or "LOCATION:"
리턴 array

processDateConversions() 공개 메소드

Add fields DTSTART_tz and DTEND_tz to each event These fields contain dates adapted to the calendar timezone depending on the event TZID
public processDateConversions ( ) : void
리턴 void or false if no Events exist

processEvents() 공개 메소드

Adds a unix timestamp to all DT{START|END|RECURRENCE-ID}_array arrays Makes a note of modified recurrence-instances
public processEvents ( ) : void
리턴 void or false if no Events exist

processRecurrences() 공개 메소드

Processes recurrence rules
public processRecurrences ( ) : void
리턴 void or false if no Events exist

sortEventsWithOrder() 공개 메소드

Sort events based on a given sort order
public sortEventsWithOrder ( array $events, integer $sortOrder = SORT_ASC ) : sorted
$events array An array of EventObjects
$sortOrder integer Either SORT_ASC, SORT_DESC, SORT_REGULAR, SORT_NUMERIC, SORT_STRING
리턴 sorted array of EventObjects

프로퍼티 상세

$alteredRecurrenceInstances 보호되어 있는 프로퍼티

Event recurrence instances that have been altered
protected array $alteredRecurrenceInstances
리턴 array

$cal 공개적으로 프로퍼티

The parsed calendar
public array $cal
리턴 array

$dayOrdinals 보호되어 있는 프로퍼티

protected $dayOrdinals

$defaultSpan 공개적으로 프로퍼티

The value in years to use for indefinite, recurring events
public int $defaultSpan
리턴 integer

$defaultWeekStart 공개적으로 프로퍼티

public $defaultWeekStart

$eventCount 공개적으로 프로퍼티

How many events are in this iCal?
public int $eventCount
리턴 integer

$freebusyCount 공개적으로 프로퍼티

How many freebusy are in this iCal?
public int $freebusyCount
리턴 integer

$frequencyConversion 보호되어 있는 프로퍼티

protected $frequencyConversion

$monthNames 보호되어 있는 프로퍼티

protected $monthNames

$todoCount 공개적으로 프로퍼티

How many ToDos are in this iCal?
public int $todoCount
리턴 integer

$weekdays 보호되어 있는 프로퍼티

protected $weekdays