phpDocumentor MantisBT
classes
[ class tree: MantisBT ] [ index: MantisBT ] [ all elements ]

Class: Period

Source Location: /core/class.period.php

Class Period

Class Overview

Class for actions dealing with date periods

This class encapsulates all actions dealing with time intervals. It handles data storage, and retrieval, as well as formatting and access.

Located in /core/class.period.php [line 30]



		
				Author(s):
		
		
		
Information Tags:
Copyright:  Logical Outcome Ltd. 2005 - 2007
Link:  http://www.mantisbt.org

Properties

Methods

[ Top ]
Property Summary
string   $end  
string   $start  

[ Top ]
Method Summary
Period   Period()   Constructor
void   a_month()   set dates for a month
void   a_quarter()   set dates for a quarter
void   a_week()   set dates for a week
void   a_year()   set dates for a year
void   get_elapsed_days()   get number of days in interval
void   get_end_formatted()   get formatted end date
void   get_end_timestamp()   get end date in unix timestamp format
string   get_sql_clause()   return a matching SQL clause
void   get_start_formatted()   get formatted start date
void   get_start_timestamp()   get start date in unix timestamp format
string   get_text_clause()   return a matching text clause
void   last_month()   set dates for last month
void   last_quarter()   set dates for last month
void   last_week()   set dates for last week
void   last_year()   set dates for last year
void   month_to_date()   set dates for this month to date
void   period_selector()   print a period selector
void   quarter_to_date()   set dates for this quarter to date
void   set_period_from_selector()   set date based on period selector
void   this_month()   set dates for this month
void   this_quarter()   set dates for this quarter
void   this_week()   set dates for this week
void   this_year()   set dates for this year
void   week_to_date()   set dates for this week to date
void   year_to_date()   set dates for current year, ending today

[ Top ]
Properties
string   $end = '' [line 40]

[ Top ]
string   $start = '' [line 35]

[ Top ]
Methods
Constructor Period  [line 46]

  Period Period( )

Constructor



[ Top ]
a_month  [line 150]

  void a_month( string $p_when  )

set dates for a month

Parameters:
string   $p_when:  date string to expand to a month


[ Top ]
a_quarter  [line 187]

  void a_quarter( string $p_when  )

set dates for a quarter

Parameters:
string   $p_when:  date string to expand to a quarter


[ Top ]
a_week  [line 112]

  void a_week( string $p_when, [int $p_weeks = 1]  )

set dates for a week

Parameters:
string   $p_when:  date string to expand to a week (Sun to Sat)
int   $p_weeks:  number of weeks


[ Top ]
a_year  [line 226]

  void a_year( string $p_when  )

set dates for a year

Parameters:
string   $p_when:  date string to expand to a year


[ Top ]
get_elapsed_days  [line 294]

  void get_elapsed_days( )

get number of days in interval



[ Top ]
get_end_formatted  [line 286]

  void get_end_formatted( )

get formatted end date



[ Top ]
get_end_timestamp  [line 270]

  void get_end_timestamp( )

get end date in unix timestamp format



[ Top ]
get_sql_clause  [line 62]

  string get_sql_clause( )

return a matching SQL clause

create an SQL clause that matches the set date.


API Tags:
Return:  SQL clause


[ Top ]
get_start_formatted  [line 278]

  void get_start_formatted( )

get formatted start date



[ Top ]
get_start_timestamp  [line 262]

  void get_start_timestamp( )

get start date in unix timestamp format



[ Top ]
get_text_clause  [line 86]

  string get_text_clause( )

return a matching text clause

create an text clause that matches the set date.


API Tags:
Return:  SQL clause


[ Top ]
last_month  [line 168]

  void last_month( )

set dates for last month



[ Top ]
last_quarter  [line 206]

  void last_quarter( )

set dates for last month



[ Top ]
last_week  [line 132]

  void last_week( [int $p_weeks = 1]  )

set dates for last week

Parameters:
int   $p_weeks:  number of weeks


[ Top ]
last_year  [line 254]

  void last_year( )

set dates for last year



[ Top ]
month_to_date  [line 176]

  void month_to_date( )

set dates for this month to date



[ Top ]
period_selector  [line 303]

  void period_selector( string $p_control_name  )

print a period selector

Parameters:
string   $p_control_name: 


[ Top ]
quarter_to_date  [line 214]

  void quarter_to_date( )

set dates for this quarter to date



[ Top ]
set_period_from_selector  [line 343]

  void set_period_from_selector( string $p_control_name, [string $p_start_field = 'start_date'], [string $p_end_field = 'end_date']  )

set date based on period selector

Parameters:
string   $p_control_name: 
string   $p_start_field: 
string   $p_end_field: 


[ Top ]
this_month  [line 160]

  void this_month( )

set dates for this month



[ Top ]
this_quarter  [line 198]

  void this_quarter( )

set dates for this quarter



[ Top ]
this_week  [line 123]

  void this_week( )

set dates for this week



[ Top ]
this_year  [line 236]

  void this_year( )

set dates for this year



[ Top ]
week_to_date  [line 140]

  void week_to_date( )

set dates for this week to date



[ Top ]
year_to_date  [line 244]

  void year_to_date( )

set dates for current year, ending today



[ Top ]

Documentation generated on Sun, 05 Apr 2009 23:01:01 +0100 by phpDocumentor 1.4.1