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

Class: Calendar_Factory

Source Location: /Calendar-0.5.5/Factory.php

Class Overview


Contains a factory method to return a Singleton instance of a class


Author(s):

Copyright:

  • 2003-2007 Harry Fuecks, Lorenzo Alberton

Methods


Inherited Variables

Inherited Methods


Class Details

[line 77]
Contains a factory method to return a Singleton instance of a class

implementing the Calendar_Engine_Interface.
For Month objects, to control type of month returned, use CALENDAR_MONTH_STATE constact e.g.;

  1.  require_once 'Calendar/Factory.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.  // define ('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH); // Use Calendar_Month
It defaults to building Calendar_Month objects.
Use the constract CALENDAR_FIRST_DAY_OF_WEEK to control the first day of the week for Month or Week objects (e.g. 0 = Sunday, 6 = Saturday)



[ Top ]


Method Detail

create   [line 94]

object subclass create( string $type, [int $y = 2000], [int $m = 1], [int $d = 1], [int $h = 0], [int $i = 0], [int $s = 0])

Creates a calendar object given the type and units
  • Return: of Calendar
  • Access: public

Parameters:

string   $type     class of calendar object to create
int   $y     year
int   $m     month
int   $d     day
int   $h     hour
int   $i     minute
int   $s     second

[ Top ]

createByTimestamp   [line 155]

object subclass &createByTimestamp( string $type, mixed $stamp)

Creates an instance of a calendar object, given a type and timestamp
  • Return: of Calendar
  • Access: public

Parameters:

string   $type     type of object to create
mixed   $stamp     timestamp (depending on Calendar engine being used)

[ Top ]


Documentation generated on Thu, 24 Jun 2010 14:00:09 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.