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

Class: Calendar_Decorator

Source Location: /Calendar-0.5.5/Decorator.php

Class Overview


Decorates any calendar class.


Author(s):

Copyright:

  • 2003-2007 Harry Fuecks

Methods


Child classes:

Calendar_Decorator_Textual
Decorator to help with fetching textual representations of months and days of the week.
Calendar_Decorator_Wrapper
Decorator to help with wrapping built children in another decorator
Calendar_Decorator_Weekday
Decorator for fetching the day of the week
Calendar_Decorator_Uri
Decorator to help with building HTML links for navigating the calendar
Decorates any calendar class.
MonthDecorator
Decorates any calendar class.
MonthPayload_Decorator
Decorates any calendar class.
MyBoldDecorator
Decorates any calendar class.

Inherited Variables

Inherited Methods


Class Details

[line 65]
Decorates any calendar class.

Create a subclass of this class for your own "decoration". Used for "selections"

  1.  class DayDecorator extends Calendar_Decorator
  2.  {
  3.      function thisDay($format 'int')
  4.      {
  5.      }
  6.  }
  7.  $Day = new Calendar_Day(20031025);
  8.  $DayDecorator = new DayDecorator($Day);
  9.  echo $DayDecorator->thisDay()// Outputs "Sat"



[ Top ]


Method Detail

Calendar_Decorator (Constructor)   [line 79]

Calendar_Decorator Calendar_Decorator( object &$calendar)

Constructs the Calendar_Decorator

Parameters:

object   &$calendar   —  subclass to Calendar to decorate

[ Top ]

adjust   [line 140]

void adjust( )

Adjusts the date (helper method)
  • Access: public

[ Top ]

build   [line 272]

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

Build the children
  • Abstract:
  • Access: public

Overridden in child classes as:

MonthPayload_Decorator::build()

Parameters:

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

[ Top ]

fetch   [line 286]

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_Decorator_Wrapper::fetch()
Wraps objects returned from fetch in the named Decorator class
MonthPayload_Decorator::fetch()

[ Top ]

fetchAll   [line 297]

array fetchAll( )

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

Overridden in child classes as:

Calendar_Decorator_Wrapper::fetchAll()
Wraps the returned calendar objects from fetchAll in the named decorator

[ Top ]

getTimestamp   [line 105]

int 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 331]

Calendar_Validator &getValidator( )

Returns an instance of Calendar_Validator
  • Access: public

[ Top ]

isEmpty   [line 256]

boolean isEmpty( )

Check if the current object is empty
  • Access: public

[ Top ]

isFirst   [line 213]

boolean isFirst( )

Returns true if Day object is first in a Week Only relevant when Day is created by Calendar_Month_Weekdays::build()
  • Access: public

[ Top ]

isLast   [line 227]

boolean isLast( )

Returns true if Day object is last in a Week Only relevant when Day is created by Calendar_Month_Weekdays::build()
  • Access: public

[ Top ]

isSelected   [line 129]

boolean isSelected( )

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

[ Top ]

isValid   [line 320]

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 528]

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 567]

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 606]

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 423]

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

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

Overridden in child classes as:

MonthDecorator::nextMonth()
Override the nextMonth method to format the output

Parameters:

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

[ Top ]

nextSecond   [line 645]

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 ]

nextWeek   [line 480]

int nextWeek( [string $format = 'n_in_month'])

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

Parameters:

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

[ Top ]

nextYear   [line 384]

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 502]

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 541]

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 580]

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 397]

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

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

Overridden in child classes as:

MonthDecorator::prevMonth()
Override the prevMonth method to format the output

Parameters:

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

[ Top ]

prevSecond   [line 619]

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 ]

prevWeek   [line 436]

int prevWeek( [string $format = 'n_in_month'])

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

Parameters:

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

[ Top ]

prevYear   [line 358]

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 118]

void setSelected( [boolean $state = true])

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

Parameters:

boolean   $state   —  whether Calendar subclass must be selected

[ Top ]

setTimestamp   [line 93]

void setTimestamp( int $ts)

Defines the calendar by a Unix timestamp, replacing values passed to the constructor
  • Access: public

Parameters:

int   $ts   —  Unix timestamp

[ Top ]

size   [line 308]

int size( )

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

[ Top ]

thisDay   [line 515]

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

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

Overridden in child classes as:

MyBoldDecorator::thisDay()

Parameters:

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

[ Top ]

thisHour   [line 554]

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 593]

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 410]

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

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

Overridden in child classes as:

MonthDecorator::thisMonth()
Override the thisMonth method to format the output

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 ]

thisWeek   [line 458]

int thisWeek( [string $format = 'n_in_month'])

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

Parameters:

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

[ Top ]

thisYear   [line 371]

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 153]

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 15:37:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.