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

Class: Calendar_Year

Source Location: Program_Root/Year.php

Class Overview

Calendar
   |
   --Calendar_Year

Represents a Year and builds Months

Methods


Inherited Variables

Inherited Methods

Class: Calendar

Calendar::Calendar()
Constructs the Calendar
Calendar::build()
Abstract method for building the children of a calendar object.
Calendar::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.
Calendar::fetchAll()
Fetches all child from the current collection of children
Calendar::getTimestamp()
Returns a timestamp from the current date / time values. Format of
Calendar::getValidator()
Returns an instance of Calendar_Validator
Calendar::isSelected()
True if the calendar subclass object is selected (e.g. today)
Calendar::isValid()
Determine whether this date is valid, with the bounds determined by
Calendar::nextDay()
Returns the value for the next day
Calendar::nextHour()
Returns the value for the next hour
Calendar::nextMinute()
Returns the value for the next minute
Calendar::nextMonth()
Returns the value for next month
Calendar::nextSecond()
Returns the value for the next second
Calendar::nextYear()
Returns the value for next year
Calendar::prevDay()
Returns the value for the previous day
Calendar::prevHour()
Returns the value for the previous hour
Calendar::prevMinute()
Returns the value for the previous minute
Calendar::prevMonth()
Returns the value for the previous month
Calendar::prevSecond()
Returns the value for the previous second
Calendar::prevYear()
Returns the value for the previous year
Calendar::setSelected()
Defines calendar object as selected (e.g. for today)
Calendar::setSelection()
Abstract method for selected data objects called from build
Calendar::setTimestamp()
Defines the calendar by a Unix timestamp, replacing values
Calendar::size()
Get the number Calendar subclass objects stored in the internal collection.
Calendar::thisDay()
Returns the value for this day
Calendar::thisHour()
Returns the value for this hour
Calendar::thisMinute()
Returns the value for this minute
Calendar::thisMonth()
Returns the value for this month
Calendar::thisSecond()
Returns the value for this second
Calendar::thisYear()
Returns the value for this year

Class Details

Represents a Year and builds Months


1 require_once 'Calendar/Year.php';
2 $Year = & new Calendar_Year(2003,10,21); // 21st Oct 2003
3 $Year->build(); // Build Calendar_Month objects
4 while ($Month = & $Year->fetch()) {
5 echo $Month->thisMonth().'<br />';
6 }

access:  public

Class Methods


constructor Calendar_Year

Constructs Calendar_Year

Calendar_Year Calendar_Year( int $y)

API Tags:

access:  public

Parameters:

int   $y   year e.g. 2003

method build

Builds the Months of the Year.

Note: by defining the constant CALENDAR_MONTH_STATE you can control what class of Calendar_Month is built e.g.;


1 require_once 'Calendar/Calendar_Year.php';
2 define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS); // Use Calendar_Month_Weekdays
3 // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS); // Use Calendar_Month_Weeks
4
It defaults to building Calendar_Month objects.



boolean build( [array $sDates = array()], [int $firstDay = null])

API Tags:

access:  public
Overrides Calendar::build() (Abstract method for building the children of a calendar object.)

Parameters:

array   $sDates   (optional) array of Calendar_Month objects representing selected dates
int   $firstDay   (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)
Released under the PHP license (http://www.php.net/license/3_0.txt)
Documentation generated on Thu, 30 Oct 2003 16:36:14 +0100 by phpDocumentor 1.2.2