Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
DateTime_Field Class Reference

Public Member Functions

 DateTime_Field ($prefix, &$value, &$parameters)
 
 setValue (&$value)
 
 setParameters (&$parameters)
 
getParam ($code='')
 
 printField ()
 
 inputBox ($u, $prefix, &$value, $allow_null=FALSE)
 
 getUnit ($unit, $value='')
 
 shortMonth ($m='', $invert=FALSE)
 
 longMonth ($m='', $invert=FALSE)
 
 processField ()
 
 validateValue ($value)
 
 strToUnitsArray ($value)
 
 unitsArrayToStr ($v)
 
 format ($format=NULL)
 
 printMinField ()
 
 processMinField ()
 
 printMaxField ()
 
 processMaxField ()
 
 printEditOptions ($show=Array())
 
 processEditOptions ()
 
 isEmpty ()
 

Data Fields

 $prefix =''
 
 $value =''
 
 $parameters =''
 

Detailed Description

Definition at line 35 of file datetime_field.inc.

Member Function Documentation

DateTime_Field (   $prefix,
$value,
$parameters 
)

Constructor

Parameters
int$prefixprefix for form elements
string&$valuecurrent value of the field
array&$parameterssettings for this field (min, max, show etc)

Definition at line 98 of file datetime_field.inc.

format (   $format = NULL)

Uses date() to format a value in a given way

Parameters
string$formatthe format to print the date in (PHP date format string)

public

Returns
string

Definition at line 780 of file datetime_field.inc.

& getParam (   $code = '')

Get a parameter from the parameters array

Parameters
string$codethe name of the parameter

public

Returns
mixed

Definition at line 145 of file datetime_field.inc.

getUnit (   $unit,
  $value = '' 
)

Extracts the value of a particular unit from the full value

Parameters
string$unitthe unit to find the value for
string&$valuecurrent value of the field

public

Returns
string

Definition at line 431 of file datetime_field.inc.

inputBox (   $u,
  $prefix,
$value,
  $allow_null = FALSE 
)

Prints an input box for a particular unit

Parameters
string$uthe unit to print
string$prefixprefix for elements
string&$valuecurrent value of the unit
boolean$allow_nullallow null value (ie blank string)

public

Returns
void

Definition at line 238 of file datetime_field.inc.

isEmpty ( )

Returns TRUE if the datetime field is blank, FALSE otherwise

Returns
boolean public

Definition at line 1080 of file datetime_field.inc.

longMonth (   $m = '',
  $invert = FALSE 
)

Given a month name or number, returns the long name

Parameters
string$mthe month number or name
boolean$invertare you passing in the short name?

public

Returns
string

Definition at line 500 of file datetime_field.inc.

printEditOptions (   $show = Array())

Prints the edit options form

Parameters
Array$showan array of keys telling which parts of the interface must be printed

public

Returns
string

Definition at line 938 of file datetime_field.inc.

printField ( )

Prints the interface for filling in a value

public

Returns
void

Definition at line 171 of file datetime_field.inc.

printMaxField ( )

Prints fields for inputting the max value

public

Returns
string

Definition at line 891 of file datetime_field.inc.

printMinField ( )

Prints fields for inputting the min value

public

Returns
string

Definition at line 846 of file datetime_field.inc.

processEditOptions ( )

Processes the input in edit options form

public

Returns
string

Definition at line 1052 of file datetime_field.inc.

processField ( )

Processes the interface for filling in a value

public

Returns
boolean

Definition at line 518 of file datetime_field.inc.

processMaxField ( )

Processing the max value

public

Returns
string

Definition at line 914 of file datetime_field.inc.

processMinField ( )

Processing the min value

public

Returns
string

Definition at line 869 of file datetime_field.inc.

setParameters ( $parameters)

Sets a reference to the parameters of this field

Parameters
array&$parametersthe parameters to set

public

Returns
void

Definition at line 130 of file datetime_field.inc.

setValue ( $value)

Sets a reference to the value of this field

Parameters
string&$valuethe value to set

public

Returns
void

Definition at line 115 of file datetime_field.inc.

shortMonth (   $m = '',
  $invert = FALSE 
)

Given a month name or number, returns the short name

Parameters
string$mthe month number or name
boolean$invertare you passing in the short name?

public

Returns
string

Definition at line 479 of file datetime_field.inc.

strToUnitsArray (   $value)

Converts a datetime string "yyyy-mm-dd hh:ii:ss" to an array with an int for each unit. -1 = 'null'

Parameters
string$valuethe value to convert in "yyyy-mm-dd hh:ii:ss" format

public

Returns
array

Definition at line 727 of file datetime_field.inc.

unitsArrayToStr (   $v)

Converts an array with an int for each unit to a datetime string "yyyy-mm-dd hh:ii:ss"

Parameters
array$valuethe array to convert

public

Returns
string

Definition at line 752 of file datetime_field.inc.

validateValue (   $value)

Validates the value to ensure it is in the correct format

Parameters
string$valuethe value to check

public

Returns
string

Definition at line 540 of file datetime_field.inc.


The documentation for this class was generated from the following file: