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

Class: Calendar

Source Location: /Calendar-0.5.2/Calendar.php

Class Overview


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


Author(s):

Methods


Child classes:

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

Inherited Variables

Inherited Methods


Class Details

[line 94]
Base class for Calendar API. This class should not be instantiated directly.
  • Abstract:


[ Top ]


Method Detail

Calendar (Constructor)   [line 178]

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

Constructs the Calendar
  • Access: protected

Parameters:

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

[ Top ]

adjust   [line 249]

void adjust( )

Adjusts the date (helper method)
  • Access: public

[ Top ]

build   [line 317]

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

Abstract method for building the children of a calendar object.

Implemented by Calendar subclasses

  • 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_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_Week::build()
Builds Calendar_Day objects for this Week
Calendar_Year::build()
Builds the Months of the Year.
Calendar_Minute::build()
Builds the Calendar_Second objects
Calendar_Second::build()
Overwrite build

Parameters:

array   $sDates   —  containing Calendar objects to select (optional)

[ Top ]

fetch   [line 350]

mixed 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.
  • Return: either an object subclass of Calendar or false
  • Access: public

Overridden in child classes as:

Calendar_Second::fetch()
Overwrite fetch

[ Top ]

fetchAll   [line 366]

array fetchAll( )

Fetches all child from the current collection of children
  • Access: public

Overridden in child classes as:

Calendar_Second::fetchAll()
Overwrite fetchAll

[ Top ]

getTimestamp   [line 216]

int|string getTimestamp( )

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

timestamp depends on Calendar_Engine implementation being used

  • Return: timestamp
  • Access: public

[ Top ]

getValidator   [line 400]

Calendar_Validator &getValidator( )

Returns an instance of Calendar_Validator
  • Access: public

[ Top ]

isSelected   [line 239]

boolean isSelected( )

True if the calendar subclass object is selected (e.g. today)
  • Access: public

[ Top ]

isValid   [line 389]

boolean isValid( )

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

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

  • Access: public

[ Top ]

nextDay   [line 524]

int nextDay( [string $format = 'int'])

Returns the value for the next day
  • Return: e.g. 12 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

nextHour   [line 563]

int nextHour( [string $format = 'int'])

Returns the value for the next hour
  • Return: e.g. 14 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

nextMinute   [line 604]

int nextMinute( [string $format = 'int'])

Returns the value for the next minute
  • Return: e.g. 25 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

nextMonth   [line 486]

int nextMonth( [string $format = 'int'])

Returns the value for next month
  • Return: e.g. 6 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

nextSecond   [line 646]

int nextSecond( [string $format = 'int'])

Returns the value for the next second
  • Return: e.g. 45 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

nextYear   [line 450]

int nextYear( [string $format = 'int'])

Returns the value for next year
  • Return: e.g. 2004 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

prevDay   [line 498]

int prevDay( [string $format = 'int'])

Returns the value for the previous day
  • Return: e.g. 10 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

prevHour   [line 537]

int prevHour( [string $format = 'int'])

Returns the value for the previous hour
  • Return: e.g. 13 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

prevMinute   [line 576]

int prevMinute( [string $format = 'int'])

Returns the value for the previous minute
  • Return: e.g. 23 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

prevMonth   [line 462]

int prevMonth( [string $format = 'int'])

Returns the value for the previous month
  • Return: e.g. 4 or Unix timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

prevSecond   [line 618]

int prevSecond( [string $format = 'int'])

Returns the value for the previous second
  • Return: e.g. 43 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

prevYear   [line 426]

int prevYear( [string $format = 'int'])

Returns the value for the previous year
  • Return: e.g. 2002 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

setSelected   [line 229]

void setSelected( [boolean $state = true])

Defines calendar object as selected (e.g. for today)
  • Access: public

Parameters:

boolean   $state   —  state whether Calendar subclass

[ Top ]

setSelection   [line 333]

boolean setSelection( array $sDates)

Abstract method for selected data objects called from build
  • Abstract:
  • Access: public

Parameters:

array   $sDates   — 

[ Top ]

setTimestamp   [line 200]

void setTimestamp( int|string $ts)

Defines the calendar by a timestamp (Unix or ISO-8601), replacing values

passed to the constructor

  • Access: public

Overridden in child classes as:

Calendar_Week::setTimestamp()
Defines the calendar by a timestamp (Unix or ISO-8601), replacing values

Parameters:

int|string   $ts   —  Unix or ISO-8601 timestamp

[ Top ]

size   [line 377]

int size( )

Get the number Calendar subclass objects stored in the internal collection.
  • Access: public

Overridden in child classes as:

Calendar_Second::size()
Overwrite size

[ Top ]

thisDay   [line 511]

int thisDay( [string $format = 'int'])

Returns the value for this day
  • Return: e.g. 11 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

thisHour   [line 550]

int thisHour( [string $format = 'int'])

Returns the value for this hour
  • Return: e.g. 14 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

thisMinute   [line 590]

int thisMinute( [string $format = 'int'])

Returns the value for this minute
  • Return: e.g. 24 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

thisMonth   [line 474]

int thisMonth( [string $format = 'int'])

Returns the value for this month
  • Return: e.g. 5 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

thisSecond   [line 632]

int thisSecond( [string $format = 'int'])

Returns the value for this second
  • Return: e.g. 44 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

thisYear   [line 438]

int thisYear( [string $format = 'int'])

Returns the value for this year
  • Return: e.g. 2003 or timestamp
  • Access: public

Parameters:

string   $format   —  return value format ['int' | 'timestamp' | 'object' | 'array']

[ Top ]

toArray   [line 266]

array toArray( [mixed $stamp = null])

Returns the date as an associative array (helper method)
  • Access: public

Parameters:

mixed   $stamp   —  timestamp (leave empty for current timestamp)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:54:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.