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

Class: KFilterTimestamp

Source Location: /libraries/koowa/filter/timestamp.php

Class Overview

KObject
   |
   --KFilterAbstract
      |
      --KFilterTimestamp

Timestamp filter


Author(s):

Methods


Child classes:

KFilterTime
Time filter
KFilterDate
Date filter

Inherited Variables

Inherited Methods

Class: KFilterAbstract

KFilterAbstract::__construct()
Constructor
KFilterAbstract::addFilter()
Add a filter based on priority
KFilterAbstract::execute()
Command handler
KFilterAbstract::getHandle()
Get a handle for this object
KFilterAbstract::getInstance()
Force creation of a singleton
KFilterAbstract::getPriority()
Get the priority of the filter
KFilterAbstract::sanitize()
Sanitize a variable or data collection
KFilterAbstract::validate()
Validate a variable or data collection
KFilterAbstract::_sanitize()
Sanitize a variable only
KFilterAbstract::_validate()
Validate a variable

Class: KObject

KObject::__construct()
Constructor
KObject::get()
Get the object properties
KObject::getHandle()
Get a handle for this object
KObject::getIdentifier()
Gets the service identifier.
KObject::getMethods()
Get a list of all the available methods
KObject::getService()
Get an instance of a class based on a class identifier only creating it if it does not exist yet.
KObject::inherits()
Checks if the object or one of it's mixin's inherits from a class.
KObject::mixin()
Mixin an object
KObject::set()
Set the object properties
KObject::_initialize()
Initializes the options for the object
KObject::__call()
Search the mixin method map and call the method or trigger an error
KObject::__clone()
Preform a deep clone of the object.

Class Details

[line 18]
Timestamp filter

Validates or sanitizes a value is an ISO 8601 timestamp string.




Tags:

author:  Johan Janssens <johan@nooku.org>


[ Top ]


Class Methods


method _arrayToDate [line 118]

string _arrayToDate( array $array)

Converts an array of date parts to a string date.



Tags:

access:  protected


Parameters:

array   $array   The array of date parts.

[ Top ]

method _arrayToTime [line 142]

string _arrayToTime( array $array)

Converts an array of time parts to a string time.



Tags:

access:  protected


Parameters:

array   $array   The array of time parts.

[ Top ]

method _arrayToTimestamp [line 103]

string _arrayToTimestamp( array $array)

Converts an array of timestamp parts to a string timestamp.



Tags:

access:  protected


Parameters:

array   $array   The array of timestamp parts.

[ Top ]

method _sanitize [line 76]

string _sanitize( mixed $value)

Forces the value to an ISO-8601 formatted timestamp using a space separator ("yyyy-mm-dd hh:ii:ss") instead of a "T" separator.



Tags:

return:  The sanitized value.
access:  protected


Overridden in child classes as:

KFilterTime::_sanitize()
Forces the value to an ISO-8601 formatted time ("hh:ii:ss").
KFilterDate::_sanitize()
Forces the value to an ISO-8601 formatted date ("yyyy-mm-dd").

Overrides KFilterAbstract::_sanitize() (Sanitize a variable only)

Parameters:

mixed   $value   The value to be sanitized. If an integer, it is used as a Unix timestamp; otherwise, converted to a Unix timestamp using [[php::strtotime() | ]]. If an array, and it has *all* the keys for `Y, m, d, h, i, s`, then the array is converted into an ISO 8601 string before sanitizing.

[ Top ]

method _validate [line 33]

bool _validate( mixed $value)

Validates that the value is an ISO 8601 timestamp string.

The format is "yyyy-mm-ddThh:ii:ss" (note the literal "T" in the middle, which acts as a separator -- may also be a space). As an alternative, the value may be an array with all of the keys for `Y, m, d, H, i`, and optionally `s`, in which case the value is converted to an ISO 8601 string before validating it.

Also checks that the date itself is valid (for example, no Feb 30).




Tags:

return:  True when the variable is valid
access:  protected


Overridden in child classes as:

KFilterTime::_validate()
Validates that the value is an ISO 8601 time string (hh:ii::ss format).
KFilterDate::_validate()
Validates that a value is an ISO 8601 date string

Overrides KFilterAbstract::_validate() (Validate a variable)

Parameters:

mixed   $value   The value to validate.

[ Top ]


Documentation generated on Sun, 19 May 2013 03:07:00 +0200 by phpDocumentor 1.4.3