libraries/Calendar_Event – Kohana API 2.3 Documentation

system/libraries/Calendar_Event.php

Class: Calendar_Event_Core

class Calendar_Event_Core extends Event_Observer implements SplObserver

Calendar event observer class.


Methods

Calendar_Event_Core -> condition

public function condition

Adds a condition to the event. The condition can be one of the following:

timestamp
UNIX timestamp
day
day number (1-31)
week
week number (1-5)
month
month number (1-12)
year
year number (4 digits)
day_of_week
day of week (1-7)
current
active month (boolean) (only show data for the month being rendered)
weekend
weekend day (boolean)
first_day
first day of month (boolean)
last_day
last day of month (boolean)
occurrence
occurrence of the week day (1-5) (use with "day_of_week")
last_occurrence
last occurrence of week day (boolean) (use with "day_of_week")
easter
Easter day (boolean)
callback
callback test (boolean)

To unset a condition, call condition with a value of NULL.

Parameters:

string key
condition key
mixed value
condition value

Return: object


Calendar_Event_Core -> add_class

public function add_class

Add a CSS class for this event. This can be called multiple times.

Parameters:

string class
CSS class name

Return: object


Calendar_Event_Core -> remove_class

public function remove_class

Remove a CSS class for this event. This can be called multiple times.

Parameters:

string class
CSS class name

Return: object


Calendar_Event_Core -> output

public function output

Set HTML output for this event.

Parameters:

string str
HTML output

Return: object


Calendar_Event_Core -> notify

public function notify

Add a CSS class for this event. This can be called multiple times.

Parameters:

string data
CSS class name

Return: object


Calendar_Event_Core -> day_occurrence

protected function day_occurrence

Find the week day occurrence for a specific timestamp. The occurrence is relative to the current month. For example, the second Saturday of any given month will return "2" as the occurrence. This is used in combination with the "occurrence" condition.

Parameters:

integer timestamp
UNIX timestamp

Return: integer


Calendar_Event_Core -> __construct

public function __construct

Initializes a new observer and attaches the subject as the caller.

Parameters:

object caller
Event_Subject

Return: void


Calendar_Event_Core -> update

public function update

Updates the observer subject with a new caller.

Parameters:

object caller
Event_Subject

Return: object


Calendar_Event_Core -> remove

public function remove

Detaches this observer from the subject.

Return: object