Controller Namespace


Classes


DataGrid

constructor

With the help of this method you can create a new instance of DataGrid.

Signature

constructor(void) : Object|DataGrid

Returns

  • Object, DataGrid
    • A new instance of DataGrid

buildBaseCriteria

Build the filter criteria for a given request.

Signature

buildBaseCriteria(Object req, Object res, Object options) : Object

Parameters

  • req
    • Request to analyse
    • Type: Object
  • res
    • Response to call on errors
    • Type: Object
  • options
    • Options to use
    • Type: Object

Returns

  • Object
    • The return value is not further described

buildSqlPagination

Build a SQL pagination object by a sql-criteria object.

Signature

buildSqlPagination(Object sqlCriteria, Object options, Function callback) : Object

Parameters

  • sqlCriteria
    • Criteria object to get data from
    • Type: Object
  • options
    • Options to use
    • Type: Object
  • callback
    • Function to call on finish
    • Type: Function

Returns

  • Object
    • The return value is not further described

buildSqlCriteria

Build the SQL filter criteria for a given request.

Signature

buildSqlCriteria(Object req, Object res, Object options) : Object

Parameters

  • req
    • Request to analyse
    • Type: Object
  • res
    • Response to call on errors
    • Type: Object
  • options
    • Options to use
    • Type: Object

Returns

  • Object
    • The return value is not further described

buildNoSqlPagination

Build a NoSQL pagination object by a NoSql-criteria object.

Signature

buildNoSqlPagination(Object noSqlCriteria, Object options, Function callback) : Object

Parameters

  • noSqlCriteria
    • Criteria object to get data from
    • Type: Object
  • options
    • Options to use
    • Type: Object
  • callback
    • Function to call on finish
    • Type: Function

Returns

  • Object
    • The return value is not further described

buildNoSqlCriteria

Build the NoSQL filter criteria for a given request.

Signature

buildNoSqlCriteria(Object req, Object res, Object options) : Object

Parameters

  • req
    • Request to analyse
    • Type: Object
  • res
    • Response to call on errors
    • Type: Object
  • options
    • Options to use
    • Type: Object

Returns

  • Object
    • The return value is not further described


Date

constructor

With the help of this method you can create a new instance of Date.

Signature

constructor(void) : Object|Date

Returns

  • Object, Date
    • A new instance of Date

parse

Parse the date and return date object.

Signature

parse(String date, String format) : Date

Parameters

  • date
    • date string
    • Type: String
  • format
    • date format
    • Type: String

Returns

  • Date
    • The return value is not further described

parseToIso

Parse the date and return ISO string.

Signature

parseToIso(String date, String format) : String

Parameters

  • date
    • date string
    • Type: String
  • format
    • date format
    • Type: String

Returns

  • String
    • The return value is not further described

format

Format the date and return it as a string.

Signature

format(String date, Object formats) : String

Parameters

  • date
    • date string
    • Type: String
  • formats
    • containing both, the input and output format
    • Type: Object

Returns

  • String
    • The return value is not further described

compare

Compare two dates according to the given compare operations.

Signature

compare(Object|String firstDate, Object|String operations, Object|String secondDate) : Boolean

Parameters

  • firstDate
    • containing either both, the first date and its format, or only the date as a string
    • Types: Object, String
  • operations
    • contains an option set of operations
    • Types: Object, String
  • secondDate
    • containing either both, the second date and its format
    • Types: Object, String

Returns

  • Boolean
    • The return value is not further described


ErrorHelper

constructor

With the help of this method you can create a new instance of ErrorHelper.

Signature

constructor(void) : Object|ErrorHelper

Returns

  • Object, ErrorHelper
    • A new instance of ErrorHelper

format

Format the given error to print in an uniform way.

Signature

format(Object err) : String

Parameters

  • err
    • Error object
    • Type: Object

Returns

  • String
    • The return value is not further described

log

Log the error with the corresponding request.

Signature

log(Object req, Object err) : void

Parameters

  • req
    • Request object
    • Type: Object
  • err
    • Error object
    • Type: Object

respond500

Log the error and respond with an internal server error message (Code 500).

Signature

respond500(Object req, Object res, Object err) : void

Parameters

  • req
    • Request object
    • Type: Object
  • res
    • Response object
    • Type: Object
  • err
    • Error object
    • Type: Object

showErrorPage

Log and forward to the default error page.

Signature

showErrorPage(Object req, Object res, Object err, [String view], [Object locals]) : void

Parameters

  • req
    • Request object
    • Type: Object
  • res
    • Response object
    • Type: Object
  • err
    • Error object
    • Type: Object
  • [view]
    • Name of the error view to render
    • Type: String
  • [locals]
    • Locals to pass to the view
    • Type: Object

flash

Log and write a flash message on the next request.

Signature

flash(Object req, Object res, Object err, Object options) : void

Parameters

  • req
    • Request object
    • Type: Object
  • res
    • Response object
    • Type: Object
  • err
    • Error object
    • Type: Object
  • options
    • Options for the message
    • Type: Object


Form

constructor

With the help of this method you can create a new instance of Form.

Signature

constructor(void) : Object|Form

Returns

  • Object, Form
    • A new instance of Form

sanitizeList

Remap a scalar value into an array.

Signature

sanitizeList(Mixed list) : Array

Parameters

  • list
    • Value or list to remap to array
    • Type: Mixed

Returns

  • Array
    • The return value is not further described

logAndFlash

Log and flash the error messsages.

Signature

logAndFlash(Object req, Object err) : void

Parameters

  • req
    • Client request
    • Type: Object
  • err
    • Error Object
    • Type: Object

sanitizeIntegerList

Remap a scalar value into an array containing a single integer or convert an array into array containing only numbers.

Signature

sanitizeIntegerList(Mixed list) : Array

Parameters

  • list
    • Value or list to remap
    • Type: Mixed

Returns

  • Array
    • The return value is not further described

sanitizeStringList

Remap a scalar value into an array containing a single string or convert an array into array containing only strings.

Signature

sanitizeStringList(Mixed list) : Array

Parameters

  • list
    • Value or list to remap
    • Type: Mixed

Returns

  • Array
    • The return value is not further described

sanitizeFloatList

Remap a scalar value into an array containing a single float or convert an array into array containing only floats.

Signature

sanitizeFloatList(Mixed list) : Array

Parameters

  • list
    • Value or list to remap
    • Type: Mixed

Returns

  • Array
    • The return value is not further described