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

Class: Calendar_Decorator

Source Location: Program_Root/Decorator.php

Class Overview


Decorates any calendar class. Create a subclass of this class for your

Methods


Inherited Variables

Inherited Methods


Class Details

Decorates any calendar class. Create a subclass of this class for your

own "decoration". Used for "selections"


1 class DayDecorator extends Calendar_Decorator {
2 function thisDay($asTs = false) {
3 }
4 }
5 $Day = & new Calendar_Day(2003,10,25);
6 $DayDecorator = & new DayDecorator($Day);
7 echo ( $DayDecorator->thisDay() );

abstract:  

Class Methods


constructor Calendar_Decorator

Constructs the Calendar_Decorator

Calendar_Decorator Calendar_Decorator( object subclass &$calendar)

Parameters:

object subclass   &$calendar   to Calendar to decorate

method build

Build the children

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

API Tags:

abstract:  
access:  public

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

method fetchAll

Fetches all child from the current collection of children

array fetchAll( )

API Tags:

access:  public

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

method getValidator

Returns an instance of Calendar_Validator

Calendar_Validator &getValidator( )

API Tags:

access:  public

method isEmpty



boolean isEmpty( )

API Tags:

access:  public

method isFirst

Returns true if Day object is first in a Week

Only relevant when Day is created by Calendar_Month_Weekdays::build()



boolean isFirst( )

API Tags:

access:  public

method isLast

Returns true if Day object is last in a Week

Only relevant when Day is created by Calendar_Month_Weekdays::build()



boolean isLast( )

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

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 nextWeek

Returns the value for next week

int nextWeek( [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 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

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 prevWeek

Returns the value for the previous week

int prevWeek( [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 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 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

method thisDay

Returns the value for this day

int thisDay( [boolean $asTs = false])

API Tags:

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

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 thisWeek

Returns the value for this week

int thisWeek( [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 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:57 +0100 by phpDocumentor 1.2.2