lithium\data\source\database\adapter\PostgreSql::_formatters()

protected method

Provide an associative array of Closures to be used as the "formatter" key inside of the Database::$_columns specification.

Source

	protected function _formatters() {
		$datetime = $timestamp = function($format, $value) {
			if ($format && (($time = strtotime($value)) !== false)) {
				$val = date($format, $time);
				if (!preg_match('/^' . preg_quote($val) . '\.\d+$/', $value)) {
					$value = $val;
				}
			}
			return $this->connection->quote($value);
		};

		return compact('datetime', 'timestamp') + [
			'boolean' => function($value) {
				return $this->connection->quote($value ? 't' : 'f');
			}
		] + parent::_formatters();
	}