Calendar
[ class tree: Calendar ] [ index: Calendar ] [ all elements ]

Class: Calendar

Source Location: Program_Root/Calendar.php

Class Overview


Base class for Calendar API. This class should not be instantiated directly.

Methods


Child classes:

Calendar_Day
Represents a Day and builds Hours.
Calendar_Hour
Represents an Hour and builds Minutes
Calendar_Minute
Represents a Minute and builds Seconds
Calendar_Month
Represents a Month and builds Days
Calendar_Second
Represents a Second
Calendar_Week
Represents a Week and builds Days in tabular format
Calendar_Year
Represents a Year and builds Months

Inherited Variables

Inherited Methods


Class Details

Base class for Calendar API. This class should not be instantiated directly.
abstract:  

Class Methods


constructor Calendar

Constructs the Calendar

Calendar Calendar( [int $y = 2000], [int $m = 1], [int $d = 1], [int $h = 0], [int $i = 0], [int $s = 0])

API Tags:

access:  protected

Parameters:

int   $y   year
int   $m   month
int   $d   day
int   $h   hour
int   $i   minute
int   $s   second

method build

Abstract method for building the children of a calendar object.

Implemented by Calendar subclasses



boolean build( [array $sDates = array()])

API Tags:

abstract:  
access:  public

Overridden in child classes as:

Calendar_Day::build()
Builds the Hours of the Day
Calendar_Hour::build()
Builds the Minutes in the Hour
Calendar_Minute::build()
Builds the Calendar_Second objects
Calendar_Month::build()
Builds Day objects for this Month. Creates as many Calendar_Day objects
Calendar_Month_Weekdays::build()
Builds Day objects in tabular form, to allow display of calendar month with empty cells if the first day of the week does not fall on the first day of the month.
Calendar_Month_Weeks::build()
Builds Calendar_Week objects for the Month. Note that Calendar_Week
Calendar_Second::build()
Overwrite build
Calendar_Week::build()
Builds Calendar_Day objects for this Week
Calendar_Year::build()
Builds the Months of the Year.

Parameters:

array   $sDates   containing Calendar objects to select (optional)

method fetch

Iterator method for fetching child Calendar subclass objects (e.g. a minute from an hour object). On reaching the end of the collection, returns false and resets the collection for further iteratations.

mixed fetch( )

API Tags:

return:  either an object subclass of Calendar or false
access:  public

Overridden in child classes as:

Calendar_Second::fetch()
Overwrite fetch


method fetchAll

Fetches all child from the current collection of children

array fetchAll( )

API Tags:

access:  public

Overridden in child classes as:

Calendar_Second::fetchAll()
Overwrite fetchAll


method getTimestamp

Returns a timestamp from the current date / time values. Format of

timestamp depends on Calendar_Engine implementation being used



int getTimestamp( )

API Tags:

return:  timestamp
access:  public

Overridden in child classes as:

Calendar_Week::getTimestamp()
Returns a timestamp from the current date / time values


method getValidator

Returns an instance of Calendar_Validator

Calendar_Validator &getValidator( )

API Tags:

access:  public

method isSelected

True if the calendar subclass object is selected (e.g. today)

boolean isSelected( )

API Tags:

access:  public

method isValid

Determine whether this date is valid, with the bounds determined by

the Calendar_Engine. The call is passed on to Calendar_Validator::isValid



boolean isValid( )

API Tags:

access:  public

method nextDay

Returns the value for the next day

int nextDay( [boolean $asTs = false])

API Tags:

return:  e.g. 12 or timestamp
access:  public

Overridden in child classes as:

Calendar_Week::nextDay()
Returns the value for the next day

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method nextHour

Returns the value for the next hour

int nextHour( [boolean $asTs = false])

API Tags:

return:  e.g. 14 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method nextMinute

Returns the value for the next minute

int nextMinute( [boolean $asTs = false])

API Tags:

return:  e.g. 25 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method nextMonth

Returns the value for next month

int nextMonth( [boolean $asTs = false])

API Tags:

return:  e.g. 6 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method nextSecond

Returns the value for the next second

int nextSecond( [boolean $asTs = false])

API Tags:

return:  e.g. 45 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method nextYear

Returns the value for next year

int nextYear( [boolean $asTs = false])

API Tags:

return:  e.g. 2004 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method prevDay

Returns the value for the previous day

int prevDay( [boolean $asTs = false])

API Tags:

return:  e.g. 10 or timestamp
access:  public

Overridden in child classes as:

Calendar_Week::prevDay()
Returns the value for the previous day

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method prevHour

Returns the value for the previous hour

int prevHour( [boolean $asTs = false])

API Tags:

return:  e.g. 13 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method prevMinute

Returns the value for the previous minute

int prevMinute( [boolean $asTs = false])

API Tags:

return:  e.g. 23 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method prevMonth

Returns the value for the previous month

int prevMonth( [boolean $asTs = false])

API Tags:

return:  e.g. 4 or Unix timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method prevSecond

Returns the value for the previous second

int prevSecond( [boolean $asTs = false])

API Tags:

return:  e.g. 43 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method prevYear

Returns the value for the previous year

int prevYear( [boolean $asTs = false])

API Tags:

return:  e.g. 2002 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method setSelected

Defines calendar object as selected (e.g. for today)

void setSelected( [boolean $state = true])

API Tags:

access:  public

Parameters:

boolean   $state   state whether Calendar subclass

method setSelection

Abstract method for selected data objects called from build

boolean setSelection( array $sDates)

API Tags:

abstract:  
access:  public

Parameters:

array   $sDates  

method setTimestamp

Defines the calendar by a Unix timestamp, replacing values

passed to the constructor



void setTimestamp( int $ts)

API Tags:

access:  public

Parameters:

int   $ts   Unix timestamp

method size

Get the number Calendar subclass objects stored in the internal collection.

int size( )

API Tags:

access:  public

Overridden in child classes as:

Calendar_Second::size()
Overwrite size


method thisDay

Returns the value for this day

int thisDay( [boolean $asTs = false])

API Tags:

return:  e.g. 11 or timestamp
access:  public

Overridden in child classes as:

Calendar_Week::thisDay()
Returns the value for this day

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method thisHour

Returns the value for this hour

int thisHour( [boolean $asTs = false])

API Tags:

return:  e.g. 14 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method thisMinute

Returns the value for this minute

int thisMinute( [boolean $asTs = false])

API Tags:

return:  e.g. 24 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method thisMonth

Returns the value for this month

int thisMonth( [boolean $asTs = false])

API Tags:

return:  e.g. 5 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method thisSecond

Returns the value for this second

int thisSecond( [boolean $asTs = false])

API Tags:

return:  e.g. 44 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)

method thisYear

Returns the value for this year

int thisYear( [boolean $asTs = false])

API Tags:

return:  e.g. 2003 or timestamp
access:  public

Parameters:

boolean   $asTs   set to true to return a timestamp (optional)
Released under the PHP license (http://www.php.net/license/3_0.txt)
Documentation generated on Thu, 30 Oct 2003 16:35:54 +0100 by phpDocumentor 1.2.2